Results 1 to 2 of 2
Thread: Removing Space in File
Enjoy an ad free experience by logging in. Not a member yet? Register.
- Join Date
- Apr 2007
Removing Space in File
The output file has the table name, a space, then the record count.
I do not want that space there, but for the life of me, I can't figure out how to make it go away. I'd prefer to have a delimiter like a comma or anything else.
Here's my wee code to read the input file and create the output file (TableCount is another script that does the counting):
while read line do RECORDCOUNT=`TableCount $var1 $var2 $var3 $line` echo "$line$RECORDCOUNT" >> $TABLECOUNTS done < $TABLELIST
while read line2 do echo $line2 | sed 's/ */\|/g' >> $TABLECOUNTS2 done < $TABLECOUNTS
In the segment you posted here, it looks like there is no space, but some sort of newline instead.
Fortunately, it's relatively easy to find out what character you actually have there by using the "od" command. Try the -a and -c flags.