Hi All,
I tried posting this once before with no luck. Can someone please help me with this.
I get fixed width text files, with data looking like below.
Spiderman 4.50 Marvel
Superman 3.00
2.00 DC
Batman DC
I put the above values into three different variables
strHero
strPrice
strPublisher
I then want to print these values back to a new text file. I want to keep each line in the original file, on the same line in the new file. But if a variable is blank I don't want to print it. Any idea how to do this
Below is my output:
Hero=Spiderman,Price=4.50,Publisher=Marvel
Hero=Superman,Price=3.00
Price=2.00,Publisher=DC
Hero=Batman,Publisher=DC
As you can see from above, variables that are empty in the first file are not printed to my new file. That's where I am lost.
I tried posting this once before with no luck. Can someone please help me with this.
I get fixed width text files, with data looking like below.
Spiderman 4.50 Marvel
Superman 3.00
2.00 DC
Batman DC
I put the above values into three different variables
strHero
strPrice
strPublisher
I then want to print these values back to a new text file. I want to keep each line in the original file, on the same line in the new file. But if a variable is blank I don't want to print it. Any idea how to do this
Below is my output:
Hero=Spiderman,Price=4.50,Publisher=Marvel
Hero=Superman,Price=3.00
Price=2.00,Publisher=DC
Hero=Batman,Publisher=DC
As you can see from above, variables that are empty in the first file are not printed to my new file. That's where I am lost.