## Help with awk for selecting lines in a file avoiding repetition

Help with awk for selecting lines in a file avoiding repetition
# 1
11-26-2012
Help with awk for selecting lines in a file avoiding repetition

Hello,

I am using Awk in UBUNTU 12.04.

I have a file as following with 48,432,354 lines and 4 fields.
The file has this structure (There are repetitions of the first column in several lines)
What I want to have as an outcome is this:
That is to have a file only with the first lines of the first file. To mention, I have a file only with the list of names of the first file like this if that can be useful.
Thank you very much in advance.

Last edited by Franklin52; 11-26-2012 at 05:50 AM.. Reason: Please use code tags for data and code samples
 Homa View Public Profile for Homa Find all posts by Homa
# 2
11-26-2012
This User Gave Thanks to complex.invoke For This Post:
 complex.invoke View Public Profile for complex.invoke Find all posts by complex.invoke
# 3
11-26-2012
PERFECT! It worked, thank you very very much.
This User Gave Thanks to Homa For This Post:
 Homa View Public Profile for Homa Find all posts by Homa
# 4
11-26-2012
Hi Mr complex,

could you please let me know how it works ?

## selecting lines using awk

I have a file which contains five hundred thousand lines (500,000). I want to select lines of every 1000 lines from that file using AWK. I can think something like this in bash as below: for lines in {0..500000..1000} do ........ ........ done But I want to use AWK. I do not know how to...

## Selecting specific 'id's from lines and columns using 'SED' or 'AWK'

Hello experts, I am new to this group and to 'SED' and 'AWK'. I have data (text file) with 5 columns (C_1-5) and 100s of lines (only 10 lines are shown below as an example). I have to find or select only the id numbers (C-1) of specific lines with '90' in the same line (of C_3) AND with '20' in...

## Selecting lines of a file

Say I wanted to select the 5th line of a file without knowing the context of the file. Would I use grep and pipe it into wc or is there a more simple way of doing this?

## Selecting a range of Lines

Hi All, Is there a way to get a range of lines from a file??? I want to search through a set of scripts and need to select the group of lines which do the FTP. Say, Line1 Line2 ftp SERVER user UNAME PASS send FILE_TO_BE_SENT close Line3 Line4 Line5 ftp SERVER1 user USER1 PASS1...

## Selecting lines with sed

Hi all, I have a file with special characters like this file1 691775025 ýÄqJ8^Z^Y{ 2004-08-23E P 100.00 45585025 0527541139295037342008-07-25OEP 100.00 6983025 ýB<9D>x<^F^Xb 2004-11-16SPP 100.00 I need a sed command to print the lines which don't have special characters.ie., only line 2...

## 8. Shell Programming and Scripting

Hello , i got text file like that' C:\Users\Public\Pictures\Sample Pictures\aa.jpg C:\Users\Public\Pictures\Sample Pictures\thumb.jpg C:\Users\Public\Pictures\vv\cc.jpg C:\Users\Public\Pictures\Sample Pictures\ee.jpg C:\Users\Public\aa\Sample Pictures\cvswsr.jpg...

## Selecting Lines on text file

Hi All, I am creating a script that sends log data from text files to a Database and I will like to read sugestions, as I think that there might be better ways to achive this than with my shell script; maybe perl or I don't know, but I will like to read some sugestions. The log is from...

## Help with selecting specific lines in a large file

Hello, I need to select the 3 lines above as well as below a search string, including the search string. I have been trying various combinations using sed command without any success. Can anuone help please. Thanking