Open Text file input data and save it.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Open Text file input data and save it.
# 1  
Old 08-08-2012
MySQL Open Text file input data and save it.

Hi Guys,

I have blank file A.txt

I will run the script xyz.sh

First i want to open a.txt file...

Now i will enter some data like

Code:
XYZ
ABC
PQR
..

Save it and keep continue my script....

END of my script.

Thanks
# 2  
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:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
Login or Register to Ask a Question