Jump to content


Photo

Shell Script Help

shellscript readfile csv xml php

  • Please log in to reply
4 replies to this topic

#1 PriteshP23

PriteshP23

    Advanced Member

  • Members
  • PipPipPip
  • 79 posts
  • Age:24

Posted 26 October 2013 - 05:07 PM

Hello,
 
I have one tar.Z file. I have to run shell script daily as it is required to update the database.
 
    customer_yyyymmdd_hhmi.tar.Z
    
    sales_ yyyymmdd_hhmi.csv (5 MB - 20 MB)
    purchase_ yyyymmdd_hhmi.xml (650 MB - 950 MB)
I have made small part of XML file. There are 4 parts. There is PHP Script which is working but i need to change each time file like PART1.xml, PART2.xml etc. 
 
Things to do:
 
1) Extract tar.Z file and Read CSV and XML file.
2) Read whole XML file automatically.
 
I hope i am clear. Thanks in advanced for your time and input.
 

" I will Win not immediately, but Definitely. "

 


#2 trq

trq

    Advanced Member

  • Administrators
  • 31,018 posts
  • LocationSydney, Australia.

Posted 26 October 2013 - 09:29 PM

You forgot to ask a question / tell us what the problem is.

http://thorpesystems.com | http://proemframework.org | http://github.com/trq

SmtpCatcher - A very simple mock sendmail useful for testing PHP mail scripts.
OPM - My Linux package manager.


#3 PriteshP23

PriteshP23

    Advanced Member

  • Members
  • PipPipPip
  • 79 posts
  • Age:24

Posted 27 October 2013 - 12:41 PM

You forgot to ask a question

 

 

Well, I have already mentioned that "Things to do:"

 

The problem is that i am looking for a shell script which can perform expected operation.


" I will Win not immediately, but Definitely. "

 


#4 Irate

Irate

    Advanced Member

  • Members
  • PipPipPip
  • 358 posts
  • LocationHamburg, Germany
  • Age:17

Posted 27 October 2013 - 01:05 PM

What have you tried so far? Where are you stuck?
Quod placet mihi non placeat tibi. - What I think to be good must not always equal your perception of it.

I am not perfect. I try a lot with the code I provide and I don't guarantee for it to work as I have mostly no option to test it on my mobile phone. I do apologize for any inconvenience I caused, but if I do happen to have helped, liking my posts or marking them as to have solved or answered your question would be nice.

#5 PriteshP23

PriteshP23

    Advanced Member

  • Members
  • PipPipPip
  • 79 posts
  • Age:24

Posted 27 October 2013 - 05:48 PM

Where are you stuck? 

 

 
 
#!/bin/sh
DB_USER="****"
DB_PASS="****"
DB_NAME="****"
echo "##########"
echo $1
echo "##########"
echo
date
cd customer
for i in *-*.php
do 
  echo $i
  php $i $1
  echo
  date

I need something like this. This is just REFERENCE. It is not working.


" I will Win not immediately, but Definitely. "

 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com