It would have been better to show what you had tried so we can see your preferred style/tools etc. That way we would find a solution that you could understand better when you come back to the code in a few years time for any reason.
Do you have a plan for how you would achieve this with processes you already know? We could help adapt them.
In any case, another option (and there will be plenty more:-
This will find any rows with 5 commas, however rows with more commas are also collected because the search for 5 is contained within them.
If you want to find rows with fewer that 4 delimiters, try this variation:-
This will find any rows with four commas and then the -v flag will exclude them, so you get anything less than four reported.
my input file(.txt) has the information like
-------------------------------------
WS=123hi4
wd=WAST,RDP
------------------------------------
i need out like
----------------------------------
"where WS='123hi4' and wd in ('WAST','RDP')" (2 Replies)
Hi,
I am trying to truncate word after comma in a file ONLY if there are already 2 words BEFORE comma. If there is one word or 3 or more words BEFORE comma, then I have to leave the data AS IS. See below for example.
Input File :
John Smith, Manager
Smith, John Frank
J F K... (2 Replies)
without using conventional file searching commands like find etc, is it possible to locate a file if i just know that the file that i'm searching for contains a particular text like "Hello world" or something? (5 Replies)
Hi
Can any one pls tell me how to grep this line
POPULATION,69691,20120509
I want the number 69691 from the above line.
How to grep from the first comma till the next comma.
Thank You.:confused: (8 Replies)
Hi,
I'm dealing with an issue and losing a lot of hours figuring out how i would solve this.
I have an input file which looks like this:
('BLABLA +200-GRS','Serviço ','TarifaçãoServiço','wap.bla.us.0000000121',2985,0,55,' de conversão em escada','Dia','Domingos')
('BLABLA +200-GRR','Serviço... (6 Replies)
Hello there,
I have a comma separated csv , and all the text field is wrapped by double quote. Issue is some text field contain comma as well inside double quote. so it is difficult to process.
Input in the csv file is ,
1,234,"abc,12,gh","GH234TY",34
I need output like below,... (8 Replies)
I,
I have a file and i need to replace comma and blank space with comma and 0.
cat file.txt
a,5
b,1
c,
d,
e,4
I need the output as
cat file.txt
a,5
b,1
c,0
d,0 (4 Replies)
I have a comma delimited file of major codes and descriptions. I want to replace all occurrences of spaces with underscores up to the first comma (only in the first field), but not replace spaces following the comma. For instance I have the following snippet of the file:
EK ED,Elementary and... (7 Replies)
Hi Experts,
Please support
I have below data in file in comma seperated, but 4th column is containing comma in between numbers, bcz of which when i tried to parse the file the column 6th value(5049641141) is being removed from the file and value(222.82) in column 5 becoming value of column6.
... (3 Replies)
can anyone help me!!!! How to I parse the CSV file
file name : abc.csv (csv file) The above file containing data like
abv,sfs,,hju,',',jkk wff,fst,,rgr,',',rgr ere,edf,erg,',',rgr,rgr I have a requirement like i have to extract different field and assign them into different... (4 Replies)
Discussion started by: J.Jena
4 Replies
LEARN ABOUT REDHAT
history
HISTORY(5) File Formats Manual HISTORY(5)NAME
history - record of current and recently expired Usenet articles
DESCRIPTION
The file <pathdb in inn.conf>/history keeps a record of all articles currently stored in the news system, as well as those that have been
received but since expired. In a typical production environment, this file will be many megabytes.
The file consists of text lines. Each line corresponds to one article. The file is normally kept sorted in the order in which articles
are received, although this is not a requirement. Innd(8) appends a new line each time it files an article, and expire(8) builds a new
version of the file by removing old articles and purging old entries.
Each line consists of two or three fields separated by a tab, shown below as :
[Hash] date
[Hash] date token
The Hash field is the ASCII representation of the hash of the Message-ID header. This is directly used for the key of the dbz(3).
The date field consists of three sub-fields separated by a tilde. All sub-fields are the text representation of the number of seconds
since the epoch -- i.e., a time_t; see gettimeofday(2). The first sub-field is the article's arrival date. If copies of the article are
still present then the second sub-field is either the value of the article's Expires header, or a hyphen if no expiration date was speci-
fied. If an article has been expired then the second sub-field will be a hyphen. The third sub-field is the value of the article's Date
header, recording when the article was posted.
The token field is a token of the article. This field is empty if the article has been expired.
For example, an article whose Message-ID was <7q2saq$sal$1@isrv4.pa.vix.com>, posted on 26 Aug 1999 08:02:34 GMT and recieved at 26 Aug
1999 08:06:54 GMT, could have a history line (broken into three lines for display) like the following:
[E6184A5BC2898A35A3140B149DE91D5C]
935678987~-~935678821
@030154574F00000000000007CE3B000004BA@
In addition to the text file, there is a dbz(3) database associated with the file that uses the Message-ID field as a key to determine the
offset in the text file where the associated line begins. For historical reasons, the key includes the trailing byte (which is not
stored in the text file).
HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews. This is revision 1.12.2.1, dated 2000/08/17.
SEE ALSO dbz(3), expire(8), inn.conf(5), innd(8), makehistory(8).
HISTORY(5)