move file after validation The Next CEO of Stack OverflowShell script and crontab to capture file size, name and date in a CSV file and then send via email?Shell script to Capture the file name and size in csv file and add header on that fileMove the files from a folder and its subfolder to the same destination foldercannot move Directory not emptySearch a directory recursively for files listed in a csv, and copy them to another locationNeed to parse a csv file and it should store in variableMathematical calculation from different files inside directory using for loopShell Scripting for moving files from source to target dirScript needs to move one file to another directory; can't move it without its parent directory treevalidation of records

How to make a software documentation "officially" citable?

How do spells that require an ability check vs. the caster's spell save DC work?

Return the Closest Prime Number

Text adventure game code

Describing a person. What needs to be mentioned?

When did Lisp start using symbols for arithmetic?

How do I construct this japanese bowl?

How do scammers retract money, while you can’t?

How can I get through very long and very dry, but also very useful technical documents when learning a new tool?

What is the difference between "behavior" and "behaviour"?

Where to find order of arguments for default functions

Customer Requests (Sometimes) Drive Me Bonkers!

Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?

Visit to the USA with ESTA approved before trip to Iran

Why do remote companies require working in the US?

Implement the Thanos sorting algorithm

How to count occurrences of text in a file?

How do we know the LHC results are robust?

Science fiction novels about a solar system spanning civilisation where people change their bodies at will

Apart from "berlinern", do any other German dialects have a corresponding verb?

Trouble understanding the speech of overseas colleagues

Too much space between section and text in a twocolumn document

Does it take more energy to get to Venus or to Mars?

How do I go from 300 unfinished/half written blog posts, to published posts?



move file after validation



The Next CEO of Stack OverflowShell script and crontab to capture file size, name and date in a CSV file and then send via email?Shell script to Capture the file name and size in csv file and add header on that fileMove the files from a folder and its subfolder to the same destination foldercannot move Directory not emptySearch a directory recursively for files listed in a csv, and copy them to another locationNeed to parse a csv file and it should store in variableMathematical calculation from different files inside directory using for loopShell Scripting for moving files from source to target dirScript needs to move one file to another directory; can't move it without its parent directory treevalidation of records










0















Hi i have two files in the staging location.



  1. /projects/staging/mvn_file_data_001.csv, /projects/staging/mvn_file_data_002.csv,
    /projects/staging/mvn_file_data_003.csv
    /projects/staging/mvn_file_data_00n.csv- these files contains the complete data row wise.

corresponding to these files i have



  1. /projects/staging/loaded_mvn_file_001.call,
    /projects/staging/loaded_mvn_file_002.call
    /projects/staging/loaded_mvn_file_003.call
    /projects/staging/loaded_mvn_file_00n.call

First i have to move the all the csv files to a temp location



temporary_csv =/projects/staging/temp_csv/



Second i have to move all the .call file to a temporary location



temporary_ok=/projects/staging/temp_ok



Now i have to compare these file which i have done using the if clause



now i have for loop for traversing the csv filehave defined variables



for i in temporary_csv - this will pick up all the file name with csv extension



count_csv = cat $i|wc -l



count_ok = i have found a way to fetch the count in ok files i dont remember right now.



the main issue is i have applied a an if clause



if [ $count_csv==$count_ok ] ; then
i want move the csv files back to staging location after validation



i.e /projects/staging/



else



move the file into bad directory



i.e /projects/bad



fi



done



now i have to take the validate this for multiple file is my above statement with the for loop correct for traversing the file and checking the record count or there is something else required.










share|improve this question






















  • What shell are you proposing to use for this? The syntax does not match any shell that I'm aware of. Are you asking about the general algorithm? Could you pleas clarify the actual question?

    – Kusalananda
    yesterday















0















Hi i have two files in the staging location.



  1. /projects/staging/mvn_file_data_001.csv, /projects/staging/mvn_file_data_002.csv,
    /projects/staging/mvn_file_data_003.csv
    /projects/staging/mvn_file_data_00n.csv- these files contains the complete data row wise.

corresponding to these files i have



  1. /projects/staging/loaded_mvn_file_001.call,
    /projects/staging/loaded_mvn_file_002.call
    /projects/staging/loaded_mvn_file_003.call
    /projects/staging/loaded_mvn_file_00n.call

First i have to move the all the csv files to a temp location



temporary_csv =/projects/staging/temp_csv/



Second i have to move all the .call file to a temporary location



temporary_ok=/projects/staging/temp_ok



Now i have to compare these file which i have done using the if clause



now i have for loop for traversing the csv filehave defined variables



for i in temporary_csv - this will pick up all the file name with csv extension



count_csv = cat $i|wc -l



count_ok = i have found a way to fetch the count in ok files i dont remember right now.



the main issue is i have applied a an if clause



if [ $count_csv==$count_ok ] ; then
i want move the csv files back to staging location after validation



i.e /projects/staging/



else



move the file into bad directory



i.e /projects/bad



fi



done



now i have to take the validate this for multiple file is my above statement with the for loop correct for traversing the file and checking the record count or there is something else required.










share|improve this question






















  • What shell are you proposing to use for this? The syntax does not match any shell that I'm aware of. Are you asking about the general algorithm? Could you pleas clarify the actual question?

    – Kusalananda
    yesterday













0












0








0








Hi i have two files in the staging location.



  1. /projects/staging/mvn_file_data_001.csv, /projects/staging/mvn_file_data_002.csv,
    /projects/staging/mvn_file_data_003.csv
    /projects/staging/mvn_file_data_00n.csv- these files contains the complete data row wise.

corresponding to these files i have



  1. /projects/staging/loaded_mvn_file_001.call,
    /projects/staging/loaded_mvn_file_002.call
    /projects/staging/loaded_mvn_file_003.call
    /projects/staging/loaded_mvn_file_00n.call

First i have to move the all the csv files to a temp location



temporary_csv =/projects/staging/temp_csv/



Second i have to move all the .call file to a temporary location



temporary_ok=/projects/staging/temp_ok



Now i have to compare these file which i have done using the if clause



now i have for loop for traversing the csv filehave defined variables



for i in temporary_csv - this will pick up all the file name with csv extension



count_csv = cat $i|wc -l



count_ok = i have found a way to fetch the count in ok files i dont remember right now.



the main issue is i have applied a an if clause



if [ $count_csv==$count_ok ] ; then
i want move the csv files back to staging location after validation



i.e /projects/staging/



else



move the file into bad directory



i.e /projects/bad



fi



done



now i have to take the validate this for multiple file is my above statement with the for loop correct for traversing the file and checking the record count or there is something else required.










share|improve this question














Hi i have two files in the staging location.



  1. /projects/staging/mvn_file_data_001.csv, /projects/staging/mvn_file_data_002.csv,
    /projects/staging/mvn_file_data_003.csv
    /projects/staging/mvn_file_data_00n.csv- these files contains the complete data row wise.

corresponding to these files i have



  1. /projects/staging/loaded_mvn_file_001.call,
    /projects/staging/loaded_mvn_file_002.call
    /projects/staging/loaded_mvn_file_003.call
    /projects/staging/loaded_mvn_file_00n.call

First i have to move the all the csv files to a temp location



temporary_csv =/projects/staging/temp_csv/



Second i have to move all the .call file to a temporary location



temporary_ok=/projects/staging/temp_ok



Now i have to compare these file which i have done using the if clause



now i have for loop for traversing the csv filehave defined variables



for i in temporary_csv - this will pick up all the file name with csv extension



count_csv = cat $i|wc -l



count_ok = i have found a way to fetch the count in ok files i dont remember right now.



the main issue is i have applied a an if clause



if [ $count_csv==$count_ok ] ; then
i want move the csv files back to staging location after validation



i.e /projects/staging/



else



move the file into bad directory



i.e /projects/bad



fi



done



now i have to take the validate this for multiple file is my above statement with the for loop correct for traversing the file and checking the record count or there is something else required.







shell-script






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked yesterday









Rahul RawatRahul Rawat

143




143












  • What shell are you proposing to use for this? The syntax does not match any shell that I'm aware of. Are you asking about the general algorithm? Could you pleas clarify the actual question?

    – Kusalananda
    yesterday

















  • What shell are you proposing to use for this? The syntax does not match any shell that I'm aware of. Are you asking about the general algorithm? Could you pleas clarify the actual question?

    – Kusalananda
    yesterday
















What shell are you proposing to use for this? The syntax does not match any shell that I'm aware of. Are you asking about the general algorithm? Could you pleas clarify the actual question?

– Kusalananda
yesterday





What shell are you proposing to use for this? The syntax does not match any shell that I'm aware of. Are you asking about the general algorithm? Could you pleas clarify the actual question?

– Kusalananda
yesterday










0






active

oldest

votes












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f508872%2fmove-file-after-validation%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f508872%2fmove-file-after-validation%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.