Count and separate entries with N/A mentioned in front


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Count and separate entries with N/A mentioned in front
# 1  
Old 07-30-2012
Count and separate entries with N/A mentioned in front

Hi all,

I have afile with following data

Quote:
xyz 123
fgh N/A
gfdh N/A
gd 3456

I want to separate, count the entries with N/A in front of it so I will have all the entries with N/A in front seprate file .

so output shuld be

Quote:
fgh N/A
gfdh N/A
# 2  
Old 07-30-2012
You can simply grep for the string. Where is the count in the output? Where should the count be placed? Maybe check grep -c. "N/A" is in the end, not in the front in your examples.
# 3  
Old 07-30-2012
Actually counting i can do by putting in excel but major issue is to separate entries of those in first column with N/A in front in second column. Hope i mentioned clearly.
# 4  
Old 07-30-2012
In your wanted output the 1st and 2nd column is not separated. Either your output is wrong or the description. ?
What about using grep? Counting in Excel is not needed if you'd use the grep -c as mentioned. Where is the problem?
# 5  
Old 07-30-2012
Nope dear in my output also first and second column are separatef actualyy counting is not a big issue. It's only separation of entries weckith N/A in front is eckan issue.Im not able to check now but wil check grep soon any idea about separation of N/A entries?please let me know.
# 6  
Old 07-30-2012
The first and second column in your example output are in the same line. It looks as if you just snipped out the lines containing N/A. Where is there a separation of both columns??? Whatever "separation" means in your case, you can use cut or awk to achive that.
# 7  
Old 07-30-2012
Yes thats I want even input is in 2 columns.here. I never draw lines to show column separation.

---------- Post updated at 10:08 AM ---------- Previous update was at 10:06 AM ----------

And using cut or awk hw shuld I write code. Kindly let me knoe
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Print the overlapping entries in 2 files to separate file

I have two files that contain overlapping positions. i want to put them together each overlapping entries in both files in to a new file (the entries of first file first and the entries of second file next) followed by blank line then next overlapping entries and so on. input1 chr1 22 ... (10 Replies)
Discussion started by: raj_k
10 Replies

2. Shell Programming and Scripting

Match first column and separate entries

Hi I have 2 big files containing following information: file 1 12345 345634 217341 87234693 8236493 file 2: 12345 1237 (6 Replies)
Discussion started by: kaav06
6 Replies

3. Shell Programming and Scripting

Separate Entries after comma

Hi All I need help to separate entries after commas in my I have 2 columns in my file like this Ramush, Shyam, Mohan First Ram, Mohan, Kaavya Second, Fourth Kavi, Ram, Shaym, Mohan Third I ahve to separate entries after comma in a separate row... (9 Replies)
Discussion started by: kareena
9 Replies

4. Shell Programming and Scripting

Match first column entries precisely and fetch whatever in front of it

Hi all I have 2 files: first file AABC TTYP JKBH CVBN NHJK KJHM Second file is AABC,XCYU,JUHD Alllele1 GACXT It is approved study TTYP,JKBH Allele2 PPRD It is clinical trial study JKBH Allele2 PPRD ... (5 Replies)
Discussion started by: Priyanka Chopra
5 Replies

5. Shell Programming and Scripting

Fetch entries in front of specific word till next word

Hi all I have following file which I have to edit for research purpose file:///tmp/moz-screenshot.png body, div, table, thead, tbody, tfoot, tr, th, td, p { font-family: "Liberation Sans"; font-size: x-small; } Drug: KRP-104 QD Drug: Placebo Drug: Metformin|Drug:... (15 Replies)
Discussion started by: Priyanka Chopra
15 Replies

6. Shell Programming and Scripting

separate old entries

Hi I have a file Stomach qwe wer qwew Liver sdfjk shdf jkasfhd I want expected out shuld be in such a way that bold letters shuld comein front of non bold letter qwe Stomach wer Stomach qwew Stomach sdfjk Liver shdf Liver... (8 Replies)
Discussion started by: manigrover
8 Replies

7. Shell Programming and Scripting

Separate certain entries from a very big file

Hello I have to separate certain entries from a Big file with so many drugs and description I want to seaprate only Drug name which is mentioned as #BEGIN_DRUGCARD DB00001(means first drug description initiated) ..same way DB00002...and so on and in description I have to separate #... (3 Replies)
Discussion started by: manigrover
3 Replies

8. Shell Programming and Scripting

Request to check:remove entries with N/A mentioned

Hi I have a file with following entries 122 N/A 123 5654656 123423 43534543 4544 45435 435454 N/A i Have to remove entries with N/A so that only 123 5654656 123423 43534543 4544 45435 remain in output file can anybody guide for a code/unix/perl (2 Replies)
Discussion started by: manigrover
2 Replies

9. UNIX for Dummies Questions & Answers

Separate text files in a folder by word count

Hi, been searching Google for like an hour and I doubt I got the right keywords so might as well ask here. What I need: Before: Article1.txt 564 Article2.txt 799 Article3.txt 349 Article4.txt 452 * Separate files over 400 wordcount * After: Article1.txt 564... (3 Replies)
Discussion started by: Richard2000
3 Replies

10. Shell Programming and Scripting

count data separate by comma

hi experts, i have some problem with count data which separate by comma, below sample data : 01,011222823b6d,011222823f29,0028a5,002993,6212345678, 659111111111,6598204507,6281105008,6596197849,_,525016160836958,_, ffffffff,000000000000000000000000,_,_,_,fd,fd,ff,00,1,0028a5-002993,_,... (10 Replies)
Discussion started by: bucci
10 Replies
Login or Register to Ask a Question