Wow it works like a champ, how cool is that? Thanks to the both of you for you help.
So I Googled around a little, and everyone shows how to do use it but not really any discription on what exactly it is. Let me see if I understand correctly.
IFS = Input Field Seperator; does that work for any kind of input like getline or a filename.sh < filename.lst etc.? Thanks again!
yes, it does work on every form of input where "fields" are regarded. It will, for instance, affect the way the statement "read word1 word2 remainder" works, because a "word" is basically something surrounded by two IFS chars, whatever that may be (or BOF/EOF, of course).
Another solution to your problem is to read in your file in a loop:
But notice, that it is necessary to protect (by quoting) your resulting variables. Once you set $IFS back to its original value you can't rely on the array elements not being split up into words if you do not surround them with double quotes.
Right on, thanks bakunin. I am taking an alternate approach with this script. I havn't worked with functions much and arrays at all, so I am making a script entirely based on this to attempt to broaden by abilities. The script looks really tidy, and probably runs faster setup this way; rather then reading an endless amount of awk statements, for loops etc. Thanks to all for the help.
Experts,
I'm having problems with a portion of my perl script.
I have a perl array that contains the following:
Port1,circuit3,2;4
Port2,circuit1,9;6
Port3,circuit2,12;5
Port4,circuit4,11;10;3
Port5,circuit7,8;7;1
I'm trying to produce the following output: (3 Replies)
Hello All,
Q1) I have the below code but when the email was sent out all lines are merged and coming out as a single line though my printf statement has newline "\n", How do i avoid that?
Q2) In my second IF statement when i introduced the backslash "\" for continuation of a line or command, i... (10 Replies)
I have an ultra 10 - running solaris 9 that I installed a few weeks ago...
I am not sure how to phrase this but basically I have some html doc's that I store on the ultra but I want people to be able to access from their windows workstation on our lan...
How can I do this?
If you could help... (4 Replies)
We have a situation in a large dept of programmers where critical accounting data files were deleted. Is there any way in UNIX to trace deletions and or possibly retrieve the deleted file? (14 Replies)