Sponsored Content
Top Forums Shell Programming and Scripting Sed insert text at first line of empty file Post 302497749 by DC Slick on Friday 18th of February 2011 01:42:07 AM
Old 02-18-2011
What are my alternatives? Examples?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SED- Insert text at top of file

Does anyone know how to insert text at the top and bottom of a file using sed? (12 Replies)
Discussion started by: MBGPS
12 Replies

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

3. Shell Programming and Scripting

Need to insert new text and change existing text in a file using SED

Hi all, I need to insert new text and change existing text in a file. For that I used the below line in the command line and got the expected output. sed '$a\ hi... ' shell > shell1 But I face problem when using the same in script. It is throwing the error as, sed: command garbled:... (4 Replies)
Discussion started by: iamgeethuj
4 Replies

4. Shell Programming and Scripting

sed insert text at particular line

I know that sed -n '12p' file will print line 12 but how might I insert text to a specified line? thanks (2 Replies)
Discussion started by: action_owl
2 Replies

5. Shell Programming and Scripting

Using sed to insert text file at first line

sed '1r file.txt' <source.txt >desti.txt This example will insert 'file.txt' between line 1 and 2 of source.txt. sed '0r file.txt' <source.txt >desti.txt gives an error message. Does anyone know how 'sed' can insert 'file.txt' before the first line of source.txt? (18 Replies)
Discussion started by: psve
18 Replies

6. Shell Programming and Scripting

Delete the last empty/blank line of the text file

Hi All, I have a file.txt which seems like having three lines. wc -l file.txt 3 file.txt In fact, once it is open in text editor, this file has four lines where the last line is empty. how can i delete this last empty line of the file.txt? I tried the codes below so far but they... (6 Replies)
Discussion started by: senayasma
6 Replies

7. Shell Programming and Scripting

insert text into empty file

I have an awk script to extract data from several files and create output in the following format as a csv file: xxxx 01/04/12 0001 0 When data is present, I have a file. When no data is available in the input files, I would still like to create a file that looks like this: xxxx... (1 Reply)
Discussion started by: banjo25
1 Replies

8. Shell Programming and Scripting

sed - insert text if column empty

Hi, I want to insert the text 'Unknown' in 2 specific columns in a csv file (actually | separated) if the column is blank. Its always the same columns. I have tried using sed: sed "s/||/|Unknown|/g" but there are occasion where other fields are blank and they need to be left blank. This... (4 Replies)
Discussion started by: ksexton
4 Replies

9. Shell Programming and Scripting

How to read a text file line by line and insert into a database table?

I have a test file that I want to read and insert only certain lines into the the table based on a filter. 1. Rread the log file 12 Hours back Getdate() -12 Hours 2. Extract the following information on for lines that say "DUMP is complete" A. Date B. Database Name C.... (2 Replies)
Discussion started by: JolietJake
2 Replies

10. 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
LIBMTP_album_struct(3)						      libmtp						    LIBMTP_album_struct(3)

NAME
libmtp - LIBMTP_album_struct SYNOPSIS
#include <libmtp.h> Data Fields uint32_t album_id uint32_t parent_id uint32_t storage_id char * name char * artist char * composer char * genre uint32_t * tracks uint32_t no_tracks LIBMTP_album_t * next Detailed Description MTP Album structure Examples: sendtr.c. Field Documentation uint32_t LIBMTP_album_struct::album_id Unique playlist ID Referenced by LIBMTP_Create_New_Album(), LIBMTP_Get_Album(), LIBMTP_Get_Album_List_For_Storage(), LIBMTP_new_album_t(), LIBMTP_Set_Album_Name(), and LIBMTP_Update_Album(). char* LIBMTP_album_struct::artist Name of album artist Examples: sendtr.c. Referenced by LIBMTP_Create_New_Album(), LIBMTP_destroy_album_t(), and LIBMTP_Update_Album(). char* LIBMTP_album_struct::composer Name of recording composer Examples: sendtr.c. Referenced by LIBMTP_Create_New_Album(), LIBMTP_destroy_album_t(), and LIBMTP_Update_Album(). char* LIBMTP_album_struct::genre Genre of album Examples: sendtr.c. Referenced by LIBMTP_Create_New_Album(), LIBMTP_destroy_album_t(), and LIBMTP_Update_Album(). char* LIBMTP_album_struct::name Name of album Examples: sendtr.c. Referenced by LIBMTP_Create_New_Album(), LIBMTP_destroy_album_t(), LIBMTP_Set_Album_Name(), and LIBMTP_Update_Album(). LIBMTP_album_t* LIBMTP_album_struct::next Next album or NULL if last album Examples: sendtr.c. Referenced by LIBMTP_Get_Album_List_For_Storage(). uint32_t LIBMTP_album_struct::no_tracks The number of tracks in this album Examples: sendtr.c. Referenced by LIBMTP_Create_New_Album(), LIBMTP_Get_Album(), LIBMTP_Get_Album_List_For_Storage(), and LIBMTP_Update_Album(). uint32_t LIBMTP_album_struct::parent_id ID of parent folder Referenced by LIBMTP_Create_New_Album(), LIBMTP_Get_Album(), and LIBMTP_Get_Album_List_For_Storage(). uint32_t LIBMTP_album_struct::storage_id ID of storage holding this album Examples: sendtr.c. Referenced by LIBMTP_Create_New_Album(), LIBMTP_Get_Album(), and LIBMTP_Get_Album_List_For_Storage(). uint32_t* LIBMTP_album_struct::tracks The tracks in this album Examples: sendtr.c. Referenced by LIBMTP_Create_New_Album(), LIBMTP_destroy_album_t(), LIBMTP_Get_Album(), LIBMTP_Get_Album_List_For_Storage(), and LIBMTP_Update_Album(). Author Generated automatically by Doxygen for libmtp from the source code. Version 1.1.3 Sun Feb 17 2013 LIBMTP_album_struct(3)
All times are GMT -4. The time now is 04:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy