Sponsored Content
Top Forums Shell Programming and Scripting How to read nth word from delimited text file? Post 302653917 by balajesuri on Monday 11th of June 2012 02:59:26 AM
Old 06-11-2012
Code:
awk -F'~' 'NR==1{print $2,$4}' input.txt

This User Gave Thanks to balajesuri For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Can a shell script pull the first word (or nth word) off each line of a text file?

Greetings. I am struggling with a shell script to make my life simpler, with a number of practical ways in which it could be used. I want to take a standard text file, and pull the 'n'th word from each line such as the first word from a text file. I'm struggling to see how each line can be... (5 Replies)
Discussion started by: tricky
5 Replies

2. UNIX for Dummies Questions & Answers

nth Columns in a Tab delimited file

Hi Can anyone help me to identify the nth field from a Tab delimited file? Thanks Subrat (8 Replies)
Discussion started by: subrat
8 Replies

3. Shell Programming and Scripting

how to read delimited text into array

I am trying to parse a string using delimited char into array. BNAME=B10,B20,B30 B10.Q=X B20.Q=Y B30.Q=Z I need to parsethe BNAME into array, then i will loop through array to execute command using these variables. like: for i in $array do qload array array.Q # execute command: qload B10... (3 Replies)
Discussion started by: adars1
3 Replies

4. Shell Programming and Scripting

Read last word of nth line

Hi people; i want to read the last word of the 14th line of my file1.txt. Here is the EXACT 14th line of the file. 250 SectorPortnum=3,AuxPortInUngo=2,PortDeviceGroup=1,PortDeviceSet=1,PorDevice=1 20 >>> Set. i have to get the word Set. how can i call it and also how... (3 Replies)
Discussion started by: gc_sw
3 Replies

5. UNIX for Dummies Questions & Answers

how to read the second word of a text file

Folks, how to read the second word of the first line from a text file. Text file does not have any delimiters in the line and has words at random locations. Basically the text file is a log and i want to capture a number that is in second position. Appreciate your help Venu (1 Reply)
Discussion started by: venu
1 Replies

6. Shell Programming and Scripting

Extract a nth field from a comma delimited file

Hi, In my file (which is "," delimited and text qualifier is "), I have to extract a particualr field. file1: 1,"aa,b",4 expected is the 2nd field: aa,b I tried the basic cut -d "," -f 2 file 1, this gave me aa alone instead aa,b. A small hint ot help on this will be very... (5 Replies)
Discussion started by: machomaddy
5 Replies

7. Shell Programming and Scripting

awk read one delimited file, search another delimited file

Hello folks, I have another doozy. I have two files. The first file has four fields in it. These four fields map to different locations in my second file. What I want to do is read the master file (file 2 - 23 fields) and compare each line against each record in file 1. If I get a match in all four... (4 Replies)
Discussion started by: dagamier
4 Replies

8. Programming

How can I read complete word from text file?

how can I know that the word in test file end at this point .... I have an Idea to search on ' ' , '\n' or '\0' but don't know what function can store the string before those characters .. help please ! (3 Replies)
Discussion started by: fwrlfo
3 Replies

9. Shell Programming and Scripting

Find for line with not null values at nth place in pipe delimited file

Hi, I am trying to find the lines in a pipe delimited file where 11th column has not null values. Any help is appreciated. Need help asap please. thanks in advance. (3 Replies)
Discussion started by: manikms
3 Replies

10. UNIX for Dummies Questions & Answers

Need to convert a pipe delimited text file to tab delimited

Hi, I have a rquirement in unix as below . I have a text file with me seperated by | symbol and i need to generate a excel file through unix commands/script so that each value will go to each column. ex: Input Text file: 1|A|apple 2|B|bottle excel file to be generated as output as... (9 Replies)
Discussion started by: raja kakitapall
9 Replies
OGGFWD(1)						    BSD General Commands Manual 						 OGGFWD(1)

NAME
oggfwd -- pipe an Ogg stream from stdin to an Icecast server SYNOPSIS
oggfwd [-hp] [-d description] [-g genre] [-n name] [-u URL] address port password mountpoint DESCRIPTION
The oggfwd utility acts as a minimal source client for Icecast servers. It reads an Ogg stream from stdin and forwards it to a server speci- fied on the command line. The address, port, password and mountpoint arguments are mandatory and have to be given in that order. Optional command line parameters -d description Set the stream description. -g genre Set the stream genre. -h Print a short usage summay. -n name Set the stream (i.e. radio) name. -p Allow the stream to be made public in stream directories. -u URL Set the stream URL. oggfwd reacts to the hangup signal, SIGHUP, by printing the amount of bytes read from stdin to stdout at the next given opportunity. How fast it reacts depends on the stream's current bitrate. EXAMPLES
To forward a public Ogg stream with the name ``Test radio'' to an Icecast server, one would pipe that stream to an oggfwd command line such as oggfwd -p -n "Test radio" radio.example.com 8000 password /stream.ogg Encode an Ogg Vorbis stream, dump it to disk and stream it at the same time: oggenc - < input.wav | tee streamdump.ogg | oggfwd radio.example.com 8000 password /stream.ogg AUTHORS
Programming by J^ <j@v2v.cc> rafael2k <rafael@riseup.net> Moritz Grimm <gtgbr@gmx.net> This manual was contributed by Moritz Grimm. CAVEATS
Since the password to the Icecast server is given in clear text on the command line, other (local) users will probably be able to see it very easily. BSD
July 30, 2006 BSD
All times are GMT -4. The time now is 04:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy