Sponsored Content
Top Forums Shell Programming and Scripting Sort a file content with space Post 302893045 by SriniShoo on Monday 17th of March 2014 06:38:14 AM
Old 03-17-2014
Code:
awk '{fname = "";
 for(i = 6; i <= NF; i++)
  {fname = (fname == "") ? $i : (fname OFS $i)};
 if(a[fname]++ == 0) {print $0}}'

This User Gave Thanks to SriniShoo For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

remove space from file content

i am a bit new to shell scripting i have a file containing xxxx xx xx but i want to output the content as xxxxxxxx. thus removing the space. any idea how i can do this (4 Replies)
Discussion started by: blackzinga
4 Replies

2. UNIX for Dummies Questions & Answers

sort and find duplicates for files with no white space

example data 5666700842511TAfmoham03151008075205999900000001000001000++ 5666700843130MAfmoham03151008142606056667008390315100005001 6666666663130MAfmoham03151008142606056667008390315100005001 I'd like to sort on position 10-14 where the characters are eq "130MA". Then based on positions... (0 Replies)
Discussion started by: mmarshall
0 Replies

3. Shell Programming and Scripting

Sort content of text file based on date?

I now have a 230,000+ lines long text file formatted in segments like this: Is there a way to sort this file to have everything in chronological order, based on the date and time in the text? In this example, I would like the result to be: (19 Replies)
Discussion started by: KidCactus
19 Replies

4. UNIX for Advanced & Expert Users

Script to sort the files and append the extension .sort to the sorted version of the file

Hello all - I am to this forum and fairly new in learning unix and finding some difficulty in preparing a small shell script. I am trying to make script to sort all the files given by user as input (either the exact full name of the file or say the files matching the criteria like all files... (3 Replies)
Discussion started by: pankaj80
3 Replies

5. Shell Programming and Scripting

Grep empty space and sort

Hi Expert, Kindly request for your expertise in this matter. I have below output: 12.125.124.173,xx1.common.com 12.125.124.174,xx2.common.com 12.125.124.175,xx3.common.com 12.125.124.176, 12.125.124.177, 12.125.124.178, 12.125.124.179,xx4.common.com 12.125.124.180,xx5.common.com... (8 Replies)
Discussion started by: regmaster
8 Replies

6. Shell Programming and Scripting

Sort a file content using one column

Hello All, I have a file which have content as below. 03/09/2014 10:35 AM 618 Admin\rick pqr_ klm2_pog12_20140309_c.xlsx 03/10/2014 10:35 AM 618 user\test01 mplz_ fgh2_lal12_20140310_c.xlsx 03/17/2014 10:35 AM 618 Admin\vick abc_ xyz2_bc12_20140317_c.xlsx 03/18/2014 ... (2 Replies)
Discussion started by: kumar30213
2 Replies

7. Shell Programming and Scripting

How to remove exisiting file content from a file and have to append new file content?

hi all, i had the below script x=`cat input.txt |wc -1` awk 'NR>1 && NR<'$x' ' input.txt > output.txt by using above script i am able to remove the head and tail part from the input file and able to append the output to the output.txt but if i run it for second time the output is... (2 Replies)
Discussion started by: hemanthsaikumar
2 Replies

8. Shell Programming and Scripting

Replace file name with Space as content

Hi, I am having a files in my directory like this: 2014 1049_file1.txt 2014 1050_file2.txt 2014 1110_file3.txt 2014 1145_file4.txt 2014 2049_file5.txt I need to replace the above file names like this without changing the content of filename: file1.txt file2.txt file3.txt... (10 Replies)
Discussion started by: rohit_shinez
10 Replies

9. UNIX for Dummies Questions & Answers

How to sort a content of a text file using a shell script?

I am new to shell scripting. I am interested how to know how to sort a content of a file using shell scripting. I've attached the 'Input file' and the 'expected output' to this thread. Details provided in the expected output file will provide details on how the sort needs to be done. ... (16 Replies)
Discussion started by: nkarthik_mnnit
16 Replies

10. Shell Programming and Scripting

How to Modify a file content in UNIX and sort for only required fields ?

I have the below contents in a file after making the below curl call curl ... | grep -E "state|Rno" | paste -sd',\n' | grep "Disconnected" > test "state" : "Disconnected",, "Rno" : "5554f1d2" "state" : "Disconnected",, "Rno" : "10587563" "state" : "Disconnected",, "Rno" :... (2 Replies)
Discussion started by: Vaibhav H
2 Replies
devfs(7FS)                                                         File Systems                                                         devfs(7FS)

NAME
devfs - Devices file system DESCRIPTION
The devfs filesystem manages a name space of all devices under the Solaris operating environment and is mounted during boot on the /devices name space. The /devices name space is dynamic and reflects the current state of accessible devices under the Solaris operating environment. The names of all attached device instances are present under /devices. The content under /devices is under the exclusive control of the devfs filesystem and cannot be changed. The system may be configured to include a device in one of two ways: By means of dynamic reconfiguration (DR), using, for example, cfgadm(1M). For devices driven by driver.conf(4) enumeration, edit the driver.conf file to add a new entry, then use update_drv(1M) to cause the system to re-read the driver.conf file and thereby enumerate the instance. The device may be attached through a number of system calls and programs, including open(2), stat(2) and ls(1). During device attach, the device driver typically creates minor nodes corresponding to the device via ddi_create_minor_node(9F). If the attach is successful, one or more minor nodes referring to the device are created under /devices. Operations like mknod(2), mkdir(2) and creat(2) are not supported in /devices. FILES
/devices Mount point for devfs file system SEE ALSO
devfsadm(1M), vfstab(4), attach(9E) NOTES
The /devices name space cannot be unmounted. All content at or below the /devices name space is an implementation artifact and subject to incompatible change or removal without notifi- cation. SunOS 5.10 26 Oct 2004 devfs(7FS)
All times are GMT -4. The time now is 08:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy