Sponsored Content
Top Forums UNIX for Dummies Questions & Answers format values in a text file using cat command Post 302551288 by kpopfreakghecky on Tuesday 30th of August 2011 02:57:23 AM
Old 08-30-2011
format values in a text file using cat command

Hello...

Is it possible that we can change the format of the values we entered in a text file using cat?

Like for example, I will create a text file names.txt using cat and as I save the names and view the text file... the format will be like this

Image


but here in my code....

Code:
echo "Enter First Name: "
read firstname
echo $firstname | cat >> names.txt

echo "Enter Last Name: "
read lastname
echo $lastname | cat >> names.txt

It would make this output in the notepad...

Image

I hope someone can help me regarding this....

Thank you so much ^_^

Moderator's Comments:
Mod Comment Please use code tags, thanks.

Last edited by kpopfreakghecky; 08-30-2011 at 04:17 AM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

cat in the command line doesn't match cat in the script

Hello, So I sorted my file as I was supposed to: sort -n -r -k 2 -k 1 file1 | uniq > file2 and when I wrote > cat file2 in the command line, I got what I was expecting, but in the script itself ... sort -n -r -k 2 -k 1 averages | uniq > temp cat file2 It wrote a whole... (21 Replies)
Discussion started by: shira
21 Replies

2. UNIX for Dummies Questions & Answers

Creating File using the CAT Command

Hello , I am newbie to UNIX platform . I have read that there are two ways of creating files that is using 1.) Cat 2.) touch . With Cat Command i am unable to create a File , i is saying No file or Directory exists I logged in with root as user . please help (7 Replies)
Discussion started by: Ravi Pavanv
7 Replies

3. Shell Programming and Scripting

Identify high values "ÿ" in a text file using Unix command

I have high values (such as ÿÿÿÿ) in a text file contained in an Unix AIX server. I need to identify all the records which are having these high values and also get the position/column number in the record structure if possible. Is there any Unix command by which this can be done to : 1.... (5 Replies)
Discussion started by: devina
5 Replies

4. UNIX for Dummies Questions & Answers

stuck in editing file with cat command

Hi, While editing a small text file with cat command i pressed ctrl-d to send eof, instead of coming out of cat command it echoed ^D to the screen. Same thing is happening to ctrl-c. After googling i found this is because of trap. The problem is i m stuck in editing mode and cannot get the... (3 Replies)
Discussion started by: TITANIUM
3 Replies

5. Shell Programming and Scripting

Cat Values from Several files if it meets criteria for column values

I have results from some statistical analyses. The format of the results are as given below: I want to select lines that have a p-value (last column) less than 0.05 from all the results files (*.results) and cat to a new results file. It would be very nice if a new column is added that tells... (2 Replies)
Discussion started by: genehunter
2 Replies

6. Shell Programming and Scripting

How can I read variable text files through cat command?

Hi. I'm just wondering how can I read variable text files through cat command. I made a shell script to count frequency of words and array them with variable conditions. It's only working for one file that I wrote in script now. But I want to make it working for every text file when I execute... (2 Replies)
Discussion started by: rlaxodus
2 Replies

7. UNIX for Dummies Questions & Answers

Cat command drops lines in output file

I use the cat command to concatenate text files, but one of the rows I was expecting doesn't display in the output file. Is there a verbose mode\logging mechanism for the cat command to help me investigate where the lines I was expecting are going?? cat 7760-001_1_*_06_*.txt | grep -v... (1 Reply)
Discussion started by: Xin Xin
1 Replies

8. Shell Programming and Scripting

Read record from the text file contain multiple separated values & assign those values to variables

I have a file containing multiple values, some of them are pipe separated which are to be read as separate values and some of them are single value all are these need to store in variables. I need to read this file which is an input to my script Config.txt file name, first path, second... (7 Replies)
Discussion started by: ketanraut
7 Replies

9. Shell Programming and Scripting

Cat files listed in text file and redirect to new directory with same filename

I have a directory that is restricted and I cannot just copy the files need, but I can cat them and redirect them to a new directory. The files all have the date listed in them. If I perform a long listing and grep for the date (150620) I can redirect that output to a text file. Now I need to... (5 Replies)
Discussion started by: trigger467
5 Replies

10. UNIX for Beginners Questions & Answers

How to change the format of an Excel from exponential to text through UNIX command?

How to change the format of an excel from exponential to text through UNIX command We have a pipe delimited file in which one particular A column is a combination of number+text and while converting into excel using tr command it is generating a exponential data for the A column. Kindly... (2 Replies)
Discussion started by: AbiramiRaja
2 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:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy