02-17-2013
It reads the entire file, one line at a time, into the variables listed. It uses IFS to change the shell's default delimiters. It will split on all characters listed in IFS.
Running the code would also give you a better idea what it does.
Running cut to edit individual lines is like making 300 phone calls to say one word apiece. Best to break that habit as early as possible.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have a list of files with names as "FULL_abcd_xyz_timestamp.txt" and "FULL_xx_abcd_xyz_timestamp.txt". I am writing a script with a 'for loop' to take each file, strip the "FULL" and "timestamp" from the file name and do some actions on the contains of the file. So I need to know the number of... (4 Replies)
Discussion started by: ayanbiswas
4 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I need to find the number of tab delimiters in the first line of a file.So using
word=`head -1 files.txt`
I have extracted the first line of file into a variable word.It has 20 tab delimted columns.So can anyone help me in finding the number of delimiters?
I am using csh and I am a... (5 Replies)
Discussion started by: poornimajayan
5 Replies
3. Shell Programming and Scripting
Hi All,
I am doing a perl script validation for Phone numbers.
The normal phone number format is 01-32145.
I need to do two validations for the phone number
1) A valid phone number can have at least two digits as prefix and at least five digits as postfix. e.g. 01-01011
2) A... (5 Replies)
Discussion started by: subin_bala
5 Replies
4. Shell Programming and Scripting
I have the following string sample:
bla bla bla bla bla
I would like to extract the "123" using awk.
I thought about awk -F"]" '{ print $1 }' but it doesn't work
Any ideas ? (7 Replies)
Discussion started by: gdub
7 Replies
5. Shell Programming and Scripting
Hello
If you wanted to sort a .csv file that was filled with lines like this:
<Ticker>,<Date as YYYYMMDD>,<Time as H:M:S>,<Volume>,<Corr>
(H : , M, S: )
by date, does anybody know of a better solution than to turn the 3rd and 4th colons of every line into commas, sorting on four keys,... (20 Replies)
Discussion started by: Ryan.
20 Replies
6. Shell Programming and Scripting
Hi,
I have a problem to concatenate the lines based on number of delimiters (if the delimiter count is 9 then concatenate all the fields & remove the new line char bw delimiters and then write the following data into second line) in a file.
my input file content is
Title| ID| Owner|... (4 Replies)
Discussion started by: bi.infa
4 Replies
7. Shell Programming and Scripting
Hi Everyone,
I have a flatfile "inbox.txt" which contains some information:
Location 0, folder "Inbox", SIM memory, Inbox folder
SMS message
SMSC number : "+24800000023"
Sent : Sat 04 Aug 2012 09:01:00 PM +0700
Coding : Default GSM alphabet... (5 Replies)
Discussion started by: testcase
5 Replies
8. Shell Programming and Scripting
Hi Folks,
This is the first time I ever encountered this situation
My input file is of this kind
cat input.txt
1 PAIXAF 0 1 1 -9 0 0 0 1 2 0 2 1 2 1
7 PAIXEM 0 7 1 -9 1 0 2 0 1 2 2 1 0 2
9 PAKZXY 0 2 1 -9 2 0 1 1 1 0 1 2 0 1
Till the sixth column (which is -9), I want my columns to... (4 Replies)
Discussion started by: jacobs.smith
4 Replies
9. Shell Programming and Scripting
What to know the way to count the number of delimiters in each record by ignoring the escape delimiters.
Sample Data:
12345678|ABN\|XYZ MED CHEM PTY. LTD.|C||100.00|22|AB"C\|Corp|"XYZ|CDEF"|
I'm using awk -F'|' '{ print NF-1 }' command to find the number of delimiters. this command... (8 Replies)
Discussion started by: BrahmaNaiduA
8 Replies
10. Web Development
Hi.
I want to search 10 phone numbers automatically in Facebook and store the result in some format.
Can anyone help me with the script.
I am using kali Linux. (2 Replies)
Discussion started by: looksthatmatter
2 Replies