Sponsored Content
Top Forums UNIX for Advanced & Expert Users convert one colume file to a one line, wrapped file. Post 302263810 by jouuu on Tuesday 2nd of December 2008 02:05:58 PM
Old 12-02-2008
Forgot about tr, use to use it to change lowercase to uppercase a long time ago.
thanks
That still leaves me with a sed command to clean it up. You have definitely reduced the work load by eliminating the while loop.
I did a man on tr and still had a hard time figuring out how your syntax is working in this instance. Could you explain? "\n" " "
can it be used by redirecting output rather than redirecting out from a file as in your example to redirecting output from a script.
script produces one column of output
or does the output from script have to be redirected to a file and then passed to tr?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

read a line from a csv file and convert a column to all caps

Hello experts, I am trying to read a line from a csv file that contains '.doc' and print the second column in all caps. e.g. My csv file contains: Test.doc|This is a Test|test1|tes,t2|test-3 Test2.pdf|This is a Second Test| test1|tes,t2|t-est3 while read line do echo "$line" |... (3 Replies)
Discussion started by: orahi001
3 Replies

2. Shell Programming and Scripting

Convert comma seperated file to line seperated.

Hi, I have data like this. 1,2,3,4 Output required: 1 2 3 4 I am trying to use tr function but getting error. Help is appreciated. (6 Replies)
Discussion started by: pinnacle
6 Replies

3. UNIX for Dummies Questions & Answers

how to add a colume with serial # in a file

I am working on a file, I need add a column with serial # in a file, the column will be the first column. and the serial # will be decide by each raw, say if I have 6 raws, I need serial # from 1 to 6 in the first column. Anyone know how to add that. I really appreciate. Thanks (2 Replies)
Discussion started by: sunsnow86
2 Replies

4. Shell Programming and Scripting

Match a line in File 1 with Column in File 2 and print whole line in file 2 when matched

Hi Experts, I am very new to scripting and have a prb since few days and it is urgent to solve so much appreciated if u help me. i have 2 files file1.txt 9647810043118 9647810043126 9647810043155 9647810043161 9647810043166 9647810043185 9647810043200 9647810043203 9647810043250... (22 Replies)
Discussion started by: mustafa.abdulsa
22 Replies

5. Shell Programming and Scripting

convert Multiline file in one line file

Hi, Hi, we have one input file and file contain single line and multiline date. We want to convert multiline line in one line. Each file start with sequence of 000000001, 000000002, 000000003 so on. We want to convert the multiline line in one line. All (single line and converted multiline to... (6 Replies)
Discussion started by: humaemo
6 Replies

6. Shell Programming and Scripting

Remove new line character and add space to convert into fixed width file

I have a file with different record length. The file as to be converted into fixed length by appending spaces at the end of record. The length should be calculated based on the record with maximum length in the file. If the length is less than the max length, the spaces should be appended... (4 Replies)
Discussion started by: Amrutha24
4 Replies

7. Shell Programming and Scripting

How to convert excel file to csv file or text file?

Hi all, I need to find a way to convert excel file into csv or a text file in linux command. The reason is I have hundreds of files to convert. Another complication is the I need to delete the first 5 lines of the excel file before conversion. so for instance input.xls description of... (6 Replies)
Discussion started by: johnkim0806
6 Replies

8. Windows & DOS: Issues & Discussions

Convert UNIX text file in Windows to recognize line breaks

Hmmm I think I found the correct subforum to ask my question... I have some text files that I prepared in vi some time ago, and now I want to open and edit them with Windows Notepad. I don't have a Unix terminal at the moment so I need to do the conversion in Windows. Is there a way to do this?... (1 Reply)
Discussion started by: frys_hp
1 Replies

9. UNIX for Dummies Questions & Answers

Convert UNIX text file in Windows to recognize line breaks

Hi all, I have some text files that I prepared in vi some time ago, and now I want to open and edit them with Windows Notepad. I don't have a Unix terminal at the moment so I need to do the conversion in Windows. Is there a way to do this? Or just reinsert thousands of line breaks again :eek: ? (2 Replies)
Discussion started by: frys_hp
2 Replies

10. Shell Programming and Scripting

awk to print the line that matches and the next if line is wrapped

I have a file and when I match the word "initiators" in the first column I need to be able to print the rest of the columns in that row. This is fine for the most part but on occasion the "initiators" line gets wrapped to the next line. Here is a sample of the file. caw-enabled ... (3 Replies)
Discussion started by: kieranfoley
3 Replies
mcx convert(1)							  USER COMMANDS 						    mcx convert(1)

  NAME
      mcx convert - convert between mcx storage types

  SYNOPSIS
      mcx convert <matrix-file-in> <matrix-file-out>
      mcx convert [--write-binary] --cone-to-stack <cat-file-in> <cat-file-out>
      mcx convert [--write-binary] --stack-to-cone <cat-file-in> <cat-file-out>

      mcxconvert  is  not  in  actual fact a program. This manual page documents the behaviour and options of the mcx program when invoked in mode
      convert. The options -h, --apropos, --version, -set, --nop, -progress <num> are accessible in all mcx modes. They are described in  the  mcx
      manual page.

      mcx  convert  [--cone-to-stack  (transform  cone	file to stack file)] [--stack-to-cone (transform stack file to cone file)] [--write-binary
      (output native binary format)] [--cat (read and write cat format)] [-cat-max <num> (limit the stack conversion to <num> matrices)]

      In the two-argument invocation without additional arguments, mcx convert converts from the format found in the first file to the other  for-
      mat, i.e.  from native interchange to native binary format or the other way around. When querying with the -q option, mcx{convert} will out-
      put a one-line synopsis describing the matrix in the argument. The --cone-to-stack and --stack-to-cone options convert between the two types
      of concatenated output provided by mclcm.

  DESCRIPTION
      The  mcl	libraries make extensive use of matrices. Matrices are used to encode graphs, matrices and clusterings.  They can be stored either
      in interchange or in binary format. The latter is somewhat more efficient in storage and much faster in both reading and	writing,  but  the
      default is interchange format.

      The  mcl input routines recognize the type of storage they are dealing with. If you want to convert a matrix to the other storage type, sim-
      ply specify the file name of the matrix you want to convert.  mcx convert will recognize its type, and write the	other  type  to  the  file
      specified as the second argument.

  OPTIONS
      --cone-to-stack (transform cone file to stack file)
	This option requires two trailing options, the names of respectively the source cone file and the target stack file.

      --stack-to-cone (transform stack file to cone file)
	This option requires two trailing options, the names of respectively the source stack file and the target cone file.

      --cat (read and write cat format)

      -cat-max <num> (limit the stack conversion to <num> matrices)

      --write-binary (output native binary format)
	This option is only useful with either of the options --cone-to-stack, --stack-to-cone, or --cat.

  AUTHOR
      Stijn van Dongen.

  SEE ALSO
      mcxio(5), and mclfamily(7) for an overview of all the documentation and the utilities in the mcl family.

  mcx convert 12-068						      8 Mar 2012						      mcx convert(1)
All times are GMT -4. The time now is 09:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy