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


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers How to insert data into black column( Secound Column ) in excel (.XLSX) file using shell script?
# 1  
Old 03-20-2019
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
Code:
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
1
1
1
1
1


Last edited by Shubham1182; 03-20-2019 at 07:22 AM..
# 2  
Old 03-20-2019
Provide required input and output to help you
This User Gave Thanks to Jairaj For This Post:
# 3  
Old 03-20-2019
Quote:
Originally Posted by Shubham1182
this is my data and I want it column wise
...
What do you mean by "column wise"? As far as I can see, there is just one column?
This User Gave Thanks to RudiC For This Post:
# 4  
Old 03-20-2019
Is that something like below command you are expecting ?

Code:
 tr ' ' '\n' < File.txt

This User Gave Thanks to Jairaj For This Post:
# 5  
Old 03-20-2019
Dear Team, now i hope you will understand my problem!

Code:
#!/bin/bash
date()
{
	echo "Please Enter Hours And Minites"
	echo "Enter Hours:"
	read hrs
	echo "Enter Minites:"
	read min
	DATE=$( zenity --calendar --date-format='%Y-%m-%d '$hrs':'$min':00:000' --display=:0 )	
}
session_number()
{
	echo "Please select Session Number:"
	session_option=("1" "2" "3" "4")
	select session_option in "${session_option[@]}" "EXIT"; do 
if [[ "$REPLY" -ge 5 ]]; then
	echo "Good Bye"
	exit 1
fi
	
	echo "-------------------------------------------------------------------"
	return

done
}
subjects()
{
subject_options=("Advanced .Net"
"Advanced Analytics"
"Advanced Java"
"Android"
"Application Security & Testing"
"Aptitude Skills"
"Asp.Net"
"Big Data Technologies"
"C Programming"
"C#"
"Cloud Computing and HPC"
"Computer Awareness"
"Computer Fundamentals"
"Core Java"
"Cpp"
"Data Structures"
"Data Visualization"
"DBT"
"Effective Communication Skills"
"HTML"
"Java Script"
"JavaScript Framework"
"Linux"
"MDP"
"Mock Examination"
"Networking"
"Operating System"
"PHP"
"Practical Machine Learning"
"Project"
"Python programming"
"R Programming"
"Software Engineering"
"Software Testing"
"Test"
"Upcoming Technologies"
"Web Development"
"XML")

select subject_options in "${subject_options[@]}" "EXIT"; do 
if [[ "$REPLY" -ge 39 ]]; then
	echo "Good Bye"
	exit 1
fi
	#echo "You picked $options which is options $REPLY"
	echo "-------------------------------------------------------------------"
	break

done
}
task()
{
	task_option=("THEORY" "LAB")
	select task_option in "${task_option[@]}" "EXIT"; do 
		if [[ "$REPLY" -ge 3 ]]; then
		echo "Good Bye"
		exit 1
		fi
		#echo "You picked $options which is options $REPLY"
		echo "-------------------------------------------------------------------"
		break
		done
}
present()
{
	make_one()
	{	
		for (( i=0;i<94;i++ )); do  # Total 94 studence are there!
				echo "1" >> data.txt #making all one & storing data into file	
		done
	}
make_one
echo "Please Enter Absent Students PRN Numbers:"
read line
read -r -a array <<< "$line"
	for element in "${array[@]}"
		do		
			sed -i $element's/1/0/' data.txt   #replacing absent number by zero
		done
}
date
echo "$DATE" >> data-attendence.txt
date
echo "$DATE" >> data-attendence.txt
session_number
echo "$session_option" >> data-attendence.txt
subjects
echo "$subject_options" >> data-attendence.txt
task
echo "$task_option" >> data-attendence.txt
present
cat data.txt >> data-attendence.txt
rm -rf data.txt
awk '{ print $0 }' data-attendence.txt >> output.xlsx                                                                            ############### at this Line change is required
sleep 10
#rm -rf data-attendence.txt
exit 1

This is my Script which I make for calculating attendance of students. which gives me output.xlsx file, in this file, I am expecting Column wise output but, I get output in one column only so Please help me to solve this problem.

Last edited by Shubham1182; 03-20-2019 at 07:19 AM..
# 6  
Old 03-20-2019
Please read, understand, heed, and answer posts carefully.


Again: What do you mean by "column wise"
Is it that you want ALL output thuis far to be in one row, separated by a field separator like comma, or <TAB>? Are you aware that this won't have .xlsx structure?
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 copy a column of multiple files and paste into new excel file (next to column)?

I have data of an excel files as given below, file1 org1_1 1 1 2.5 100 org1_2 1 2 5.5 98 org1_3 1 3 7.2 88 file2 org2_1 1 1 2.5 100 org2_2 1 2 5.5 56 org2_3 1 3 7.2 70 I have multiple excel files as above shown. I have to copy column 1, column 4 and paste into a new excel file as... (26 Replies)
Discussion started by: dineshkumarsrk
26 Replies

2. Programming

Appending a column in xlsx file using Python

Is there a way to append an existing xlsx worksheet to add data from a text file ? I have an excel file for which I need to manipulate the first worksheet based on a text file. I match the text file to the xlsx and write the 'Scores' column in the xlsx sheet and save the workbook. For those ... (43 Replies)
Discussion started by: nans
43 Replies

3. Shell Programming and Scripting

Reading a column from excel using shell script in Linux environment

Hi all I am new to shell scripting. I need to read the 1st column and last of the excel file in linux environment. Can some one help me with examples (3 Replies)
Discussion started by: Vigneshj28
3 Replies

4. UNIX for Dummies Questions & Answers

Modify Column Data using Shell Script

HI Guys, Input :- P081 wr1 12p0d5: 22.8 P081 wr1 12p2d18: 23.1 P149 wr1 1pxcud6/port_0_dev_7: 20.4 P149 wr1 1pxcud4/port_1_dev_10: 22.4 OutputP081 wr1 120 22.8 P081 wr1 122 23.1 P149 wr1 10 20.4 P149 wr1 11 22.4 In in First two line delete p and after d untill : In Last two line... (4 Replies)
Discussion started by: pareshkp
4 Replies

5. Shell Programming and Scripting

Insert data in first column(if blank) from previous line first column

Dear Team I need to insert field(which is need to taken from previous line's first field) in first column if its blank. I had tried using sed but not find the way. Detail input and output file as below. Kindly help for same. INPUT: SCGR SC DEV DEV1 NUMDEV DCP ... (7 Replies)
Discussion started by: jaydeep_sadaria
7 Replies

6. Shell Programming and Scripting

Excel file attachment showing data in single column

Hi All, found similar posts, but not exatcly what i wanted. I have an text file like below and am trying to send mail as an excel file but when i get the excel file as the attachment, all the data is coming in the first column. I need below data in 4 columns. Unix file Name,ID,Trade,Date... (3 Replies)
Discussion started by: robinbannis
3 Replies

7. UNIX for Advanced & Expert Users

Convert column data to row data using shell script

Hi, I want to convert a 3-column data to 3-row data using shell script. Any suggestion in this regard is highly appreciated. Thanks. (4 Replies)
Discussion started by: sktkpl
4 Replies

8. Shell Programming and Scripting

Replace column that matches specific pattern, with column data from another file

Can anyone please help with this? I have 2 files as given below. If 2nd column of file1 has pattern foo1@a, find the matching 1st column in file2 & replace 2nd column of file1 with file2's value. file1 abc_1 foo1@a .... abc_1 soo2@a ... def_2 soo2@a .... def_2 foo1@a ........ (7 Replies)
Discussion started by: prashali
7 Replies

9. Shell Programming and Scripting

Insert and shifting data at column

Hi all, i have data like this joe : 1 :a bob : 2 :b sue : 3 :c foo : 4 :d at column 2 i want to insert TOP to the top column and at column 3 i want to insert BOTTOM to the bottom column. and the result will... (12 Replies)
Discussion started by: psychop13
12 Replies

10. Windows & DOS: Issues & Discussions

Split Data in one column into 2 column in Excel using DOS or VBScript

Hi I have some data in my Excel File.However all the data is in one single column.I want to split it into two columns. Current Data: 1,Hi Everyone,I am 7,New To Dos,And 17,VB Script,i could 110,have tried this thing 1800,in UNIX Desired Output CELL1|CELL 2 1 |Hi... (3 Replies)
Discussion started by: dashing201
3 Replies
Login or Register to Ask a Question