Sponsored Content
Top Forums Shell Programming and Scripting How to read a text file line by line and insert into a database table? Post 302920345 by SriniShoo on Thursday 9th of October 2014 01:37:16 AM
Old 10-09-2014
You are asing us to write the entire script
What have you tried?
what database are you inserting these details into?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Insert text file at a certain line.

I need to insert a file called temp_impact (which has about 15 lines in it) to a file called 11.23cfg starting at line 33. I searched the forums and found the sed '34i\ test' 11.23cfg > newfile That will enter word test at the appropriate line, but i need the entire file dumped there. Any... (4 Replies)
Discussion started by: insania
4 Replies

2. Shell Programming and Scripting

Insert a line in a text file

So I need to write lines into line X of file X. I can get the file by doing: cfgnumber=$(cat -n -comm.cfg| grep -i "servicegroup_name 24x7-comunicacions") echo $cfgnumber it outputs the Line where it finds now I need to start writing something right bellow that line. thanks (10 Replies)
Discussion started by: 4scriptmoni
10 Replies

3. Shell Programming and Scripting

How to insert some constant text at beginig of each line within a text file.

Dear Folks :), I am new to UNIX scripting and I do not know how can I insert some text in the first column of a UNIX text file at command promtp. I can do this in vi editor by using this command :g/^/s//BBB_ e,g I have a file named as Test.dat and it containins below text: michal... (4 Replies)
Discussion started by: Muhammad Afzal
4 Replies

4. Shell Programming and Scripting

bash: read file line by line (lines have '\0') - not full line has read???

I am using the while-loop to read a file. The file has lines with null-terminated strings (words, actually.) What I have by that reading - just a first word up to '\0'! I need to have whole string up to 'new line' - (LF, 10#10, 16#A) What I am doing wrong? #make file 'grb' with... (6 Replies)
Discussion started by: alex_5161
6 Replies

5. Web Development

INSERT data to a Database Table from a text file

If you have a text file and if you want to Insert data to your Database Table, You can do it with these queries LOAD DATA LOCAL INFILE '/path/yourTextFile.txt' INTO TABLE yourTableName FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\n' (0 Replies)
Discussion started by: sitex
0 Replies

6. Shell Programming and Scripting

Read text file line by line

Hi everyone, I am writing a BASH shell script that I will use to process data files. I have a text file that contains the names of the files to be processed, for example: cat filenames.txt file1 file2 file3 file4 file5 What I would like to do is set up a FOR loop within my script... (2 Replies)
Discussion started by: msb65
2 Replies

7. Shell Programming and Scripting

Shell script to read a text file line by line & process it...

Hi , I am trying to write an shell, which reads a text file (from a location) having a list of numbers of strictly 5 digits only ex: 33144 Now my script will check : 1) that each entry is only 5 digits & numeric only, no alphabets, & its not empty. 2)then it executes a shell script called... (8 Replies)
Discussion started by: new_to_shell
8 Replies

8. UNIX for Dummies Questions & Answers

Insert a line in a text file

I want to insert a line with text after the 9th line of a text file. How would I do this using sed or awk? (2 Replies)
Discussion started by: lost.identity
2 Replies

9. UNIX for Beginners Questions & Answers

Insert a line of text on nth line of a file

Hi All, I am using UNix Sun OS sun4u sparc SUNW,SPARC-Enterprise My intention is to insert a line of text after 13th line of every file inside a particular directory. While trying to do it for a single file , i am using sed sed '3 i this is the 4th line' filename sed: command garbled: 3... (5 Replies)
Discussion started by: gotamp
5 Replies

10. Shell Programming and Scripting

Shell script UNIX to read text file line by line

i have a text file as belows, it includes 2 columns, 1st is the column name, 2nd is the file_name data_file.txt column_name file_name col1 file1 col2 file2 col3 file1 col4 file1 col5 file2 now, i would like to... (4 Replies)
Discussion started by: tester111
4 Replies
DCONF(1)							   User Commands							  DCONF(1)

NAME
dconf - Simple tool for manipulating a dconf database SYNOPSIS
dconf read KEY dconf list DIR dconf write KEY VALUE dconf reset [-f] PATH dconf update dconf watch PATH dconf dump DIR dconf load DIR dconf help [COMMAND] DESCRIPTION
The dconf program can perform various operations on a dconf database, such as reading or writing individual values or entire directories. This tool operates directly on the dconf database and does not read gsettings schema information. Therefore, it cannot perform type and consistency checks on values. The gsettings(1) utility is an alternative if such checks are needed. The DIR arguments must be directory paths (starting and ending with '/'), the KEY arguments must be key paths (starting, but not ending with '/') and the PATH arguments can be either directory or key paths. VALUE arguments must be in GVariant format, so e.g. a string must include explicit quotes: "'foo'". This format is also used when printing out values. COMMANDS
read Read the value of a key. list List the sub-keys and sub-directories of a directory. write Write a new value to a key. reset Reset a key or an entire directory. For directories, -f must be specified. update Update the system dconf databases. watch Watch a key or directory for changes. dump Dump an entire subpath to stdout. The output is in a keyfile-like format, with values in GVariant syntax. load Populate a subpath from stdin. The expected format is the same as produced by dump. help Display help and exit. If COMMAND is given, display help for this command. SEE ALSO
dconf(7), gsettings(1), dconf-editor(1) dconf DCONF(1)
All times are GMT -4. The time now is 01:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy