[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] text file hard tab processing utility available
****** message to minivend-users from "Bill Randle" <billr@exgate.tek.com> ******
On Apr 27, 5:04am, Steve Fairhead wrote:
} Subject: [mv] text file hard tab processing utility available
} ****** message to minivend-users from "Steve Fairhead"
<steve@sfdesign.co.uk> ******
}
} Thus LINEPROC can be used to turn a plain text file, arranged in fixed
} columns using spaces, into a hard-tab delimited database, with user-defined
} tab stops, and all extraneous whitespace stripped out.
}
} 3) It would be easy to port this to Unix. I'd happily provide all source
} code (ANSI C); it's not rocket science. (Although I wouldn't be too
} surprised to learn there are standard Unix tools to do this sort of
} line-parsing thang.)
For converting between spaces and tabs on Unix the expand/unexpand
utlities do this. Expand converts tab to spaces and unexpand converts
spaces to tabs.
In the vein of useful little utilies, here's a simple one line shell
script I use when viewing tab delimted text files. I'm sure you've
noticed that the lines can get very long when you have a lot fields,
each seperated by a tab. This script just replaces the tabs with a '|'
to compress the line into something a little easier to read. It also
helps in seeing which fields are empty. You can replace the '|' with
any character of your choice.
tab2bar:
#!/bin/sh
tr '\t' '|'
I put it in the products directory, then use it like this:
more products.txt |tab2bar
-Bill Randle
billr@exgate.tek.com
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list