Change file content 4 column to one Column using script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Change file content 4 column to one Column using script
Prev   Next
# 1  
Old 03-02-2012
Change file content 4 column to one Column using script

Hi Gurus,

I have file content sample:

,5113955056,,TAgent-Suspend
,5119418233,,TAgent-Suspend
,5102119078,,TAgent-Suspend

filenames 120229H5_suspend, 120229H6_unsuspend

I receive those files one of directory /home/temp/

I need following:

HTML Code:
1. Backup first /home/temp/ file to /home/bak

2. File content will be changed to only one column:

5113955056
5119418233
5102119078

3. File *_suspend, *_unsuspend will be transferred to following directories:

/home/suspend/*_suspend
/home/unsuspend/*_unsuspend


4. That Script will put in Crontab for doing the operation 4 times a day. Checking /home/temp file, if present do the above operation.

5. Need a output log of that script: File processed done or No file found.
Need you help to develp the script please.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to insert data into black column( Secound Column ) in excel (.XLSX) file using shell script?

Source Code of the original script is down below please run the script and try to solve this problem this is my data and I want it column wise 2019-03-20 13:00:00:000 2019-03-20 15:00:00:000 1 Operating System LAB 0 1 1 1 1 1 1 1 1 1 0 1 (5 Replies)
Discussion started by: Shubham1182
5 Replies

2. Shell Programming and Scripting

Change data in one column with data from another file's column

Hello, I have this file outputData: # cat /tmp/outputData __Capacity^6^NBSC01_Licences^L3_functionality_for_ESB_switch __Capacity^2100^NBSC01_Licences^Gb_over_IP __Capacity^1837^NBSC01_Licences^EDGE_BSS_Fnc __Capacity^1816^NBSC01_Licences^GPRS_CS3_and_CS4... (1 Reply)
Discussion started by: nypreH
1 Replies

3. Shell Programming and Scripting

Sort a file content using one column

Hello All, I have a file which have content as below. 03/09/2014 10:35 AM 618 Admin\rick pqr_ klm2_pog12_20140309_c.xlsx 03/10/2014 10:35 AM 618 user\test01 mplz_ fgh2_lal12_20140310_c.xlsx 03/17/2014 10:35 AM 618 Admin\vick abc_ xyz2_bc12_20140317_c.xlsx 03/18/2014 ... (2 Replies)
Discussion started by: kumar30213
2 Replies

4. Shell Programming and Scripting

Change column to row base on column 2

Hi Guys, Input.txt L194 A -118.2 L194 B -115.1 L194 C -118.7 L196 A 0 L196 C 0 L197 A -111.2 L197 B -118.9 L197 C -119.9 L199 A -120.4 L199 B -119.9 ... (2 Replies)
Discussion started by: asavaliya
2 Replies

5. Shell Programming and Scripting

awk or sed: change the color of a column w/o screwing up column spacing

Hey folks. I wrote a little awk script that summarizes /proc/net/dev info and then pipes it to the nix column command to set up column spacing appropriately. Here's some example output: Iface RxMBytes RxPackets RxErrs RxDrop TxMBytes TxPackets TxErrs TxDrop bond0 9 83830... (3 Replies)
Discussion started by: ryran
3 Replies

6. Shell Programming and Scripting

Help with replace column one content based on reference file

Input file 1 testing 10 20 1 A testing 20 40 1 3 testing 23 232 2 1 testing 10 243 2 . . Reference file 1 final 3 used . . Output file (1 Reply)
Discussion started by: perl_beginner
1 Replies

7. Shell Programming and Scripting

Match column 3 in file1 to column 1 in file 2 and replace with column 2 from file2

Match column 3 in file1 to column 1 in file 2 and replace with column 2 from file2 file 1 sample SNDK 80004C101 AT XLNX 983919101 BB NETL 64118B100 BS AMD 007903107 CC KLAC 482480100 DC TER 880770102 KATS ATHR 04743P108 KATS... (7 Replies)
Discussion started by: rydz00
7 Replies

8. Shell Programming and Scripting

Need to convert the content of file into COLUMN (To export into excel)

I have multiple condition in file as below. MONITOR "ALERT_INFO" DESCRIPTION "Triggered when informational Netware alert occured" MAXTHRESHOLD 95 SEVERITY Normal MONITOR "ALERT_MAJOR" DESCRIPTION "Triggered when major Netware alert occured" MAXTHRESHOLD SEVERITY Major I need to... (6 Replies)
Discussion started by: velocitnitin
6 Replies

9. Shell Programming and Scripting

Change names in a column based on the symbols in another column

If the 4th column has - sign then the names in 3rd column has to change to some user defined names (as shown in output). Thanx input1 1 a aaaaa + 2 b bbbbb + 3 c ccccc + 4 d ddddd + 5 e eeeee + 6 f xxxxx + 8 h hhhhh +... (8 Replies)
Discussion started by: repinementer
8 Replies

10. Shell Programming and Scripting

Changing one column of delimited file column to fixed width column

Hi, Iam new to unix. I have one input file . Input file : ID1~Name1~Place1 ID2~Name2~Place2 ID3~Name3~Place3 I need output such that only first column should change to fixed width column of 15 characters of length. Output File: ID1<<12 spaces>>Name1~Place1 ID2<<12... (5 Replies)
Discussion started by: manneni prakash
5 Replies
Login or Register to Ask a Question
uadmin(2)							   System Calls 							 uadmin(2)

NAME
uadmin - administrative control SYNOPSIS
#include <sys/uadmin.h> int uadmin(int cmd, int fcn, uintptr_t mdep); DESCRIPTION
The uadmin() function provides control for basic administrative functions. This function is tightly coupled to the system administrative procedures and is not intended for general use. The argument mdep is provided for machine-dependent use and is not defined here. It should be initialized to NULL if not used. As specified by cmd, the following commands are available: A_SHUTDOWN The system is shut down. All user processes are killed, the buffer cache is flushed, and the root file system is unmounted. The action to be taken after the system has been shut down is specified by fcn. The functions are generic; the hardware capa- bilities vary on specific machines. AD_HALT Halt the processor(s). AD_POWEROFF Halt the processor(s) and turn off the power. AD_BOOT Reboot the system, using the kernel file. AD_IBOOT Interactive reboot; user is prompted for bootable program name. AD_FASTREBOOT Bypass BIOS and boot loader A_REBOOT The system stops immediately without any further processing. The action to be taken next is specified by fcn as above. A_DUMP The system is forced to panic immediately without any further processing and a crash dump is written to the dump device (see dumpadm(1M)). The action to be taken next is specified by fcn, as above. A_REMOUNT The root file system is mounted again after having been fixed. This should be used only during the startup process. A_FREEZE Suspend the whole system. The system state is preserved in the state file. The following subcommands, specified by fcn, are available. AD_SUSPEND_TO_DISK Save the system state to the state file. This subcommand is equivalent to ACPI state S4. AD_CHECK_SUSPEND_TO_DISK Check if your system supports suspend to disk. Without performing a system suspend/resume, this subcommand checks if this feature is currently available on your system. AD_SUSPEND_TO_RAM Save the system state to memory This subcommand is equivalent to ACPI state S3. AD_CHECK_SUSPEND_TO_RAM Check if your system supports suspend to memory. Without performing a system suspend/resume, this subcommand checks if this feature is currently available on your system. The following subcommands, specified by fcn, are obsolete and might be removed in a subsequent release: AD_COMPRESS Save the system state to the state file with compression of data. This subcommand has been replaced by AD_SUS- PEND_TO_DISK, which should be used instead. AD_CHECK Check if your system supports suspend and resume. Without performing a system suspend/resume, this command checks if this feature is currently available on your system. This subcommand has been replaced by AD_CHECK_SUSPEND_TO_DISK, which should be used instead. AD_FORCE Force AD_COMPRESS even when threads of user applications are not suspendable. This subcommand should never be used, as it might result in undefined behavior. RETURN VALUES
Upon successful completion, the value returned depends on cmd as follows: A_SHUTDOWN Never returns. A_REBOOT Never returns. A_FREEZE 0 upon resume. A_REMOUNT 0. Otherwise, -1 is returned and errno is set to indicate the error. ERRORS
The uadmin() function will fail if: EBUSY Suspend is already in progress. EINVAL The cmd argument is invalid. ENOMEM Suspend/resume ran out of physical memory. ENOSPC Suspend/resume could not allocate enough space on the root file system to store system information. ENOTSUP Suspend/resume is not supported on this platform or the command specified by cmd is not allowed. ENXIO Unable to successfully suspend system. EPERM The {PRIV_SYS_CONFIG} privilege is not asserted in the effective set of the calling process. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |See below. | +-----------------------------+-----------------------------+ The A_FREEZE command and its subcommands are Committed. SEE ALSO
dumpadm(1M), kernel(1M), uadmin(1M), attributes(5), privileges(5) SunOS 5.11 4 Sep 2008 uadmin(2)