Sponsored Content
Top Forums Shell Programming and Scripting HELP: I need to sort a text file in an uncommon manner, can't get desired results Post 302368780 by JakeKatz on Thursday 5th of November 2009 03:36:54 PM
Old 11-05-2009
Excellent!

That did exactly what I needed.

And I just remember mom saying "Never bite the hand that feeds you" Smilie

Thanks for your help!

J.

Quote:
Originally Posted by Scrutinizer
Hi Jake, that is very gentle since you really wrote that quite clearly Smilie. Anyway just for completeness then:
Code:
sed 's|.*\(/[^/]\+\)\(/[^/]\+\)\(/[^/]\+\)|\3\2\1 &|' dirlist.txt| sort -nt'/'|sed 's|[^ ]* ||'

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

egrep not giving desired results

I have written a shell script which looks like below: grep -v ',0,' ./DATA/abc.001 > ./DATA/abc.mid egrep $GREPSEARCH ./DATA/ebc.mid > ./DATA/abc.cut the variable GREPSEARCH has values like the below: ... (3 Replies)
Discussion started by: igandu
3 Replies

2. Shell Programming and Scripting

Helping in parsing subset of text from a big results file

Hi All, I need some help to effectively parse out a subset of results from a big results file. Below is an example of the text file. Each block that I need to parse starts with "reading sequence file 10.codon" (next block starts with another number) and ends with **p-Value(s)**. I have given... (1 Reply)
Discussion started by: Lucky Ali
1 Replies

3. Shell Programming and Scripting

Print some results in a text file using script in linux

hello everyone, i really need your help to write a script which would just print following kind of result into a text file (result.txt) XYZ test Results ID: <unique-id> Date: <date> ------------------------------------------------- | Task | Result | Time |... (3 Replies)
Discussion started by: viriimind
3 Replies

4. Shell Programming and Scripting

Sed in vi - \r and \n not giving desired results

I use many different machines at work, each with different versions of o/s's and installed applications. Sed in vi is particularly inconvenient in the sense that sometimes it will accept the "\r" as a carriage return, sometimes not. Same thing with "\n". For instance, if I have a list of hosts... (7 Replies)
Discussion started by: MaindotC
7 Replies

5. Shell Programming and Scripting

comparing 2 files and creating third file with uncommon content

I want to compare 2 files and create third file with uncommon content. e.g. file1 ajay suhas tom nisha vijay mahish file2 ajay suhas tom nisha expected output file content vijay mahish Is it possible in single command ? Thanks, Ajay (6 Replies)
Discussion started by: ajaypatil_am
6 Replies

6. Shell Programming and Scripting

Cron job is not working in the desired manner on IBM AIX

Hi, I have created a cron job on IBM AIX but it is not working in desired manner ! Here are the steps which I have followed :- #!/bin/ksh #------------------------------------------------------------------ find /some/file/at/the/user/side/test.log -exec cp {}... (8 Replies)
Discussion started by: acidburn_007
8 Replies

7. UNIX for Dummies Questions & Answers

[Solved] Slight variation from the desired results

Hello, I am writing a small one liner script to display the tables in my database. I am working with Centos 5.5 and postgresql the command is "psql -c "\dt" | awk '{print$3}'" I just want the 3rd column from the result set, but now the problem is I am getting the third column but with... (3 Replies)
Discussion started by: nnani
3 Replies

8. Shell Programming and Scripting

How to sort and compare files in more efficient manner?

Hello All, Iam using below method to sort and compare files. First iam doing sorting and changing the same file and then doing comparing and taking the final result to another file. sort -o temp.txt file1 mv temp.txt file1 sort -o temp.txt file2 mv temp.txt file2 sort -o temp.txt... (6 Replies)
Discussion started by: Vikram_Tanwar12
6 Replies

9. Shell Programming and Scripting

Needed shell script to append desired text to each line in a file

Hi, I had generated a report in my tool as followsoutput.txt 43.35 9 i needed the script to generate a new file like below i want to append the text to each of these lines of my filenewoutputfile.txt should be Total Amount : 43.35 Record Count:9 Regards, Vasa Saikumar. ... (2 Replies)
Discussion started by: hemanthsaikumar
2 Replies

10. Shell Programming and Scripting

Create a text file and a pdf file from Linux command results.

Hello. The task : Using multiple commands like : gdisk -l $SOME_DISK >> $SOME_FILEI generate some text file. For readiness I must insert page break. When the program is finished I want to convert the final text file to a pdf file. When finished, I got two files : One text file and One pdf... (1 Reply)
Discussion started by: jcdole
1 Replies
GROFF_MOM(7)						 Miscellaneous Information Manual					      GROFF_MOM(7)

NAME
groff_mom - groff `mom' macros SYNOPSIS
groff -mom [ files... ] groff -m mom [ files... ] DESCRIPTION
mom ("my own macros", "my other macros", "maximum overdrive macros", ...) is a macro set for groff, designed primarily to format documents for PostScript output. mom provides two categories of macros: macros for typesetting and macros for document processing. The typesetting macros provide access to groff's typesetting power in ways that are simpler to master and to use than groff's primitives. The document processing macros provide customizable markup "tags" that allow the user to design and output professional-looking documents with a minimum of typesetting interven- tion. mom comes with her own (very) complete documentation in HTML format. FILES
om.tmac - the main macro file mom.tmac - a wrapper file that calls om.tmac directly. </usr/share/doc/groff-base/html/mom/toc.html> - entry point to the HTML documentation /usr/share/doc/groff-base/examples/mom/* - example files using mom AUTHOR
mom was written by Peter Schaffter <peter@schaffter.ca>. Please send bug reports to the groff bug mailing list <bug-groff@gnu.org> or directly to the author at the address, above. Groff Version 1.21 25 June 2012 GROFF_MOM(7)
All times are GMT -4. The time now is 11:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy