Problem with cat and name file longer (Solved)

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
arivas_2005
Posts: 212
Joined: Sun 25 Feb 2007, 14:39

Problem with cat and name file longer (Solved)

#1 Post by arivas_2005 »

greetings to all


I need to insert text from one file into another with 'cat'

gives the following error message: not directory

the files are separate folders and have long names with special symbols.

I attach a copy for the exercise.
file of folder BASE are dragged to texbox 1 (REPORTE -BASE-) and file folder 2 are dragged to in texbox 2 ("Correo principal -1- )
code

Code: Select all

#!/bin/sh

CAPTURA=`yad --title="List archivos - drag and drog-" --geometry=500x400 \
--form --separator="©" \
--field="REPORTE -BASE-:TXT" \
--field="Correo principal -1- :TXT" \
--field="Reenvio -2-:TXT" \
--field="Respuesta -3-:TXT"`
##echo "$CAPTURA"
#echo "========================0"
#"$names" "$occupation" "Type your comments here" > /tmp/config
REPORTE=`echo "$CAPTURA" | awk -F"©" '{print $0}' |  sed 's/©\+//g'` 
Correop=`echo "$CAPTURA" | awk -F"©" '{print $1}' |  sed 's/©\+//g'`
Reenvio=`echo "$CAPTURA" | awk -v FS=© '{print $2}' |  sed 's/©\+//g'`
Respuesta=`echo "$CAPTURA" | awk -v FS=© '{print $3}' |  sed 's/©\+//g'`
#REPORTE=`echo "$CAPTURA" | cut -d"©" -f1`

echo "$Correop"
echo "_____________________________"

#  lines command problem  'cat'
cat "$Correop"
cat "$Correop">> "$REPORTE"

#######################
thanks!
Attachments
CAT-PROBLEM.zip
(2.06 KiB) Downloaded 57 times
Last edited by arivas_2005 on Mon 17 Sep 2018, 22:58, edited 1 time in total.

arivas_2005
Posts: 212
Joined: Sun 25 Feb 2007, 14:39

#2 Post by arivas_2005 »

After several hours, I have overcome my problem :D
thank you all for your support .
I already had two days of having the problem
mis excuses :lol:
code

Code: Select all

#!/bin/sh

CAPTURA=`yad --title="List archivos - drag and drog-" --geometry=500x400 \
--form --separator="©" \
--field="REPORTE -BASE-:TXT" \
--field="Correo principal -1- :TXT" \
--field="Reenvio -2-:TXT" \
--field="Respuesta -3-:TXT"`

REPORTE=`echo "$CAPTURA" | awk 'BEGIN{FS="©"} {print $1}' | sed 's/©\+//g'| sed 's/^ *//g'  | sed 's/ *$//'` 
Correop=`echo "$CAPTURA" | awk 'BEGIN{FS="©"} {print $2}' | sed 's/©\+//g' | sed 's/^ *//g' | sed 's/ *$//'`
Reenvio=`echo "$CAPTURA" | awk 'BEGIN{FS="©"} {print $3}' | sed 's/©\+//g' | sed 's/^ *//g' | sed 's/ *$//'`
Respuesta=`echo "$CAPTURA" |awk 'BEGIN{FS="©"} {print $4}' | sed 's/©\+//g' | sed 's/^ *//g' | sed 's/ *$//'`

#  lines command problem  'cat' solved with awk line form
echo "_____________________________">>"$REPORTE"
cat "$Correop" >>"$REPORTE"

#######################

Post Reply