Bone Posted February 6, 2008 Report Share Posted February 6, 2008 as dorii si eu un programel fie el de linux sau windows ..care sa copie in oglinda un txt..de ex eu am un txt cu 10 numeAsta am eu :aeinsteinalanturingalberteinsteinaleinsteinalturingamadeusaphroditearmstrongathenasi asta doresk sa faka:nietsnieagnirutnalanietsnietreblanietsnielagnirutlasuedamaetidorhpagnortsmraanehtaP.S: sa copie txt'ul in ordinea in care e el dar invers scrisul..am cautat peste tot nicaieri nu este..sau cel putin eu nu am gasit ...caut cam de 2-3 saptamani..si sunt aici in speranta ca poate primesk si eu o mana de ajutor Link to comment Share on other sites More sharing options...
moubik Posted February 6, 2008 Report Share Posted February 6, 2008 nu l-am testat. dar pare exact ceea ce doresti tuhttp://bash.cyberciti.biz/file-management/reverse-text-file.bash.php#!/bin/bash# Bash shell script to reverse text file contain i.e. concatenate files and# print on the standard output in reverse. This script also demonstrate how # to use arrays under bash shell script.# -------------------------------------------------------------------------# Copyright (c) 2005 nixCraft project <http://cyberciti.biz/fb/># This script is licensed under GNU GPL version 2.0 or above# -------------------------------------------------------------------------# This script is part of nixCraft shell script collection (NSSC)# Visit [url]http://bash.cyberciti.biz/[/url] for more information.# -------------------------------------------------------------------------FILE="$1"if [ $# -eq 0 ]; then echo "$(basename $0) - file-name" exit 1fitextArray[0]="" # hold textc=0 # counter # read whole file in loopwhile read linedo textArray[c]=$line # store line c=$(expr $c + 1) # increase counter by 1done < $FILE# get length of array len=$(expr $c - 1 )# use for loop to reverse the arrayfor (( i=$len; i>=0; i-- ));do echo ${textArray[$i]}done Link to comment Share on other sites More sharing options...
D4Rk M3sSIah Posted February 6, 2008 Report Share Posted February 6, 2008 Asta se poate face si in Borland Pascal Link to comment Share on other sites More sharing options...
Guest Kenpachi Posted February 6, 2008 Report Share Posted February 6, 2008 ti'ash fi scris eu un mic cod in php dar mai intai cere ajutorul unui meditator de limba romana si apoi revino aici. Link to comment Share on other sites More sharing options...
andrewboy Posted February 6, 2008 Report Share Posted February 6, 2008 daca vrei iti fac un cod in vizual basic.. insa ajung si eu la fel ca Zaraki Kenpachi , limba romana lipseste.. ... ia uite aici un inceput : Public Function Crypt(text As String) As StringDim x As LongFor x = 0 To Len(text) - 1Crypt = Crypt & Mid(text, (Len(text) - x), 1)Next xEnd Functionfunctia asta a fost facuta doar pentru a schimba tot textul dar daca vrei cuvant cu cuvant atunci mai si tu putin de lucru.. Link to comment Share on other sites More sharing options...
moubik Posted February 6, 2008 Report Share Posted February 6, 2008 Asta se poate face si in Borland Pascal ia vezi poate te pocnesc cu borland pascalu in cap.si in ce limbaj nu se poate face ?nu mai am chef de tampenii spuse din partea ta.SI ATAAAATEA INUTILITATI!! Link to comment Share on other sites More sharing options...
DreamsArchitect Posted February 6, 2008 Report Share Posted February 6, 2008 Ontopic : programare elementara. Da-mi un mesaj privat daca doresti sa ti-l rezolv si specifica acolo si limbajul dorit.(C, Pascal)Offtopic.Nu vreau (sau nu prea-mi pasa) sa se supere nimeni pe mine, insa observ ceva foarte trist. Ce mama naibii se mai face in sistemul de invatamant romanesc ? Chiar asa s-a ajuns, ca din 10 oameni maxim 3 sa poata sa scrie coerent si eventual corect gramatical?Inteleg ca este un mediu virtual, inteleg ca va grabiti, inteleg ca nu e lucrare de licenta, dar mai oameni buni, va rog fiti si voi mai atenti. Nu e admisibil... si asta pe un forum in care teoretic te-ai astepta sa gasesti un grad, cat de cat, ridicat de inteligenta.Citesc anumite posturi si raman siderat. Nu tu semne de punctuatie (se mai iarta), nu tu majuscule (fuck-it.. ne grabim), cratima saraca... putini guru mai stiu care si unde-i scopul ei, dar unele nici macar nu exprima o idee concreta.No amu.. doar un cuvant imi vine in minte.Amin. Link to comment Share on other sites More sharing options...
Guest Kenpachi Posted February 6, 2008 Report Share Posted February 6, 2008 se accepta :1. lipsa punctuatiei (mai putin punctul pentru a incerca totusi sa intelegem ce se vrea)2. lipsa majusculelor (cu exceptia numelor proprii atunci cand trebuie)3. lipsa unei cratime/apostrof (provocata doar de graba)nu se accepta :1.dezacordul intre subiect si predicat2.pocirea cuvintelor (cocalarii)3.scrierea incorecta a formelor de plural4.folosirea la inceputul sau sfarsitul cuvintelor a literei Â(a/A) in loc de Î(i/I)in mare cam acestea ar fi regulile de baza respecta'le si vei fi respectat. Link to comment Share on other sites More sharing options...
moubik Posted February 7, 2008 Report Share Posted February 7, 2008 scuze, primul script pe care l-am postat nu e facut de mine si mi se parea ca face altceva uite unu special pt tineuite script in perl:reverse.pl#!/usr/bin/perl$file = $ARGV[0];open (FILE, $file) || die ("could not read file");@lines = <FILE>;foreach $line (@lines){ $line = reverse $line; print $line;}poti sa folosesti scriptul in genul astaperl reverse.pl fisierdeintrare.txt > fisierdeiesire.txt Link to comment Share on other sites More sharing options...