Sponsored Content
Top Forums Shell Programming and Scripting Open Text file input data and save it. Post 302683827 by Corona688 on Wednesday 8th of August 2012 04:24:40 PM
Old 08-08-2012
You can run a text editor like vim or nano in your script.

Or you can just do something like this:

Code:
echo "Hit ctrl-D to end"
cat >filename # Read from keyboard, write to filename

This User Gave Thanks to Corona688 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Data fetched from text file and save in a csv file

Hi i have wriiten a script which fetches the data from text file, and saves in the output in a text file itself, but i want that the output should save in different columns. I have the output like: For Channel:response_time__24.txt 1547 data points 0.339 0.299 0.448 0.581 7.380 ... (1 Reply)
Discussion started by: rohitkalia
1 Replies

2. Shell Programming and Scripting

how to use data in unix text file as input to an sql query from shell

Hi, I have data in my text file something like this. adams robert ahmed gibbs I want to use this data line by line as input to an sql query which i run by connecting to an oracle database from shell. If you have code for similar scenario , please ehlp. I want the output of the sql query... (7 Replies)
Discussion started by: rdhanek
7 Replies

3. UNIX Desktop Questions & Answers

Why can't I save a VI file after entering data?

Hi I am new to linux, when I typed "vi FILE1" I was able to open VI editor. I added some data and I want to save the file and I tried :w but it threw me an error. "file1" E212: Can't open file for writing Press ENTER or type command to continue why I am not able to save it? I read it... (16 Replies)
Discussion started by: chinnanji
16 Replies

4. Shell Programming and Scripting

How to add data from 2 input files and save it in 1 output file

Hi, i have 2 input files which are file1.txt and file2.txt. I need to extract data from file1.txt and file2.txt and save it in file3.txt like example below:- File1.txt ID scrap1 Name scrap1 start 1 end 10 ID scrap2 Name scrap2 start 11 end ... (4 Replies)
Discussion started by: redse171
4 Replies

5. Shell Programming and Scripting

open file and save as script

hi guys i have a problem with my file did not work as usual. The problem is i need to open the file and save as using same name and after that the file is work properly. Is it any shell script can do open the file and save as using same name..because i have thousand of file with the same problem (3 Replies)
Discussion started by: zulabc
3 Replies

6. Shell Programming and Scripting

Get the input from user and save it as .txt file

Hi friends, I am pretty new to shell scripting, please help me in this Scenario. for example, If I have one file called input.txt once I run the script, 1.It has to delete the old input.txt and create the new input.txt (if old input.txt is not there, no offence, just it has to create a... (2 Replies)
Discussion started by: Padmanabhan
2 Replies

7. UNIX for Advanced & Expert Users

How to save a data of a file into a variable?

My requirement is to read a column data from a file & save it in a variable for each row & process it. I am using the below code- Leadlines="$TGTFILE/Error.txt">>$log_file while read line do id = ` echo $line | cut -d "," -f1 ` email = ` echo $line | cut -d "," -f2 ` ----------- done My... (2 Replies)
Discussion started by: saga20
2 Replies

8. Shell Programming and Scripting

Save input as text in directory

I am having a little trouble with some things using the code below: 1. printf "Enter variant: "; read variant The user enters the variant and that value is used in the python script. However, I am not sure how to save that value inputed as a text file in a specific directory... (8 Replies)
Discussion started by: cmccabe
8 Replies

9. UNIX for Dummies Questions & Answers

Inserting shell script input data automatically from a text file

Dear experts, I am new to linux programming. I have a shell script which i should run it on all my samples. I only define input and out put for this script. The inputs are 3 numbers(coordination numbers) which are available in a series of text file. Since i have a lots of samples, it takes a... (5 Replies)
Discussion started by: mohamadreza
5 Replies

10. Shell Programming and Scripting

Run sql query in shell script and output data save as delimited text

I want to run sql query in shell script and output data save as delimited text (delimited text would be comma) Code: SPOOL_FILE=/pgedw/dan.txt SQL=/pgedw/dan.sql sqlplus -s username/password@myhost:port/servicename <<EOF set head on set COLSEP , set linesize 32767 SET TRIMSPOOL ON SET... (8 Replies)
Discussion started by: Jaganjag
8 Replies
Text::WordDiff::ANSIColor(3pm)				User Contributed Perl Documentation			    Text::WordDiff::ANSIColor(3pm)

Name
       Text::WordDiff::ANSIColor - ANSI colored formatting for Text::WordDiff

Synopsis
	   use Text::WordDiff;

	   my $diff = word_diff 'file1.txt', 'file2.txt';
	   my $diff = word_diff $string1,   $string2,   { STYLE => 'ANSIColor' };
	   my $diff = word_diff *FH1,	     *FH2;	  \%options;
	   my $diff = word_diff &reader1,   &reader2;
	   my $diff = word_diff @records1,  @records2;

	   # May also mix input types:
	   my $diff = word_diff @records1,  'file_B.txt';

Description
       This class subclasses Text::WordDiff::Base to provide a formatting class for Text::WordDiff that uses ANSI-standard terminal escape
       sequences to highlight deleted and inserted text. This formatting class is the default class used by Text::WordDiff; see its documentation
       for details on its interface. This class should never be used directly.

       Text::WordDiff::ANSIColor formats word diffs for viewing in an ANSI-standard terminal session. The diff content is highlighted as follows:

       Deletes
	   Deleted words will display in bold-faced red. The ANSI standard for strikethrough is also used, but since it is not supported by most
	   terminals, likely will not show up.

       Inserts
	   Inserted words will display in bold-faced, underlined green.

       All other content is simply returned.

See Also
       Text::WordDiff
       Text::WordDiff::HTML

Support
       This module is stored in an open repository at the following address:

       <https://svn.kineticode.com/Text-WordDiff/trunk/>

       Patches against Text::WordDiff are welcome. Please send bug reports to <bug-text-worddiff@rt.cpan.org>.

Author
       David Wheeler <david@kineticode.com>

Copyright and License
       Copyright (c) 2005-2008 David Wheeler. Some Rights Reserved.

       This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

perl v5.10.0							    2009-09-24					    Text::WordDiff::ANSIColor(3pm)
All times are GMT -4. The time now is 05:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy